How to Create a Backend for your Snap! Project Using Replit

So you got Flask working! Now for the error there, instead of

return messages

in e(), try

return tuple(messages)

(I do not know why Flask allows you to send tuples.)

either Flask does not allow
Screenshot 2022-06-19 4.34.00 PM
, or the tuple is invalid

Oh. It's the latter. Try returning str(messages) instead.

it worked!

nevermind... (i appended 3 to messages first)
Screenshot 2022-06-19 4.37.49 PM

CORS issue, fix:

unless i have to use the call() block

nvm replied to early

I added "WarpedWartWars here!" multiple times. But I'm getting a tripled message:

(DELAYED DUE TO 2 CONSCUTIVE REPLIES THINGY)

@warped_wart_wars better add a delete from messages then xd

@warped_wart_wars weird... do not know how to fix that

Oh and to prevent caching of the output, try this:

Oh and to make it JSON-friendly, can you have it import json (standard lib, no need to install it) then, instead of str(messages), use json.dumps(messages)?

what?

I was getting ['3'] whenever I checked the output, even though the adding worked. So I added that bit to make the URL unique every time.

"?" isn't getting saved, even url encoded, so I'll see what Python's urllib module can do about that.

Edit: Can you add from urllib.parse import unquote, then, in append(), have

messages.append(unquote(input))

?

i did

@warped_wart_wars please stop replying with the server

The problem was actually in my code.

huh?????