Handling player inputs on neocities

How do I get user's commands off neocities and onto my hard drive?

Neocities only serves static resources. There's no server-side scripting at all. Which is nice, it means you don't get people forging absolute terror on your backend. Everything is served as-is. A user visits a site, you give them exactly what you gave everyone else.

I want to put my text adventure up on neocities.

Why not put it on a 'real' website? I doesn't have the same CHARM. I want it to feel olde and rustique.

I can do this, since each page of the adventure is completely static. It's just HTML with a little CSS.

The problem comes in when I want a user to be able to actually submit commands, like the text parser adventures of yore. Since neocities has no server-side scripting, this has to be processed off-site, on my own server. And then stored and retrieved later, so I can read the responses and write an update.

So, I've written a small server (literally about 200 lines of Rust) to handle and store submissions, the neocities site can just serve a small amount of JavaScript to handle sending a message over there.

The Details

The browser's view of this is very simple. When the user types and hits 'Go!' at the bottom of the lastest page of the adventure, JavaScript has to:

Simple.

The server which handles submissions has to do a little more work though. It has to:

Not to mention that, at some point, this will need to be able to:

I haven't done this yet because I genuinely don't expect more than four people to ever submit commands. I love you all though xoxo

If you want to see the code for it, you can't ehehehehe. I may put it up online amongst a greater corpus in the future. If I do, I'll update this post.

The future

In the future, the scope of this (currently tiny) project may or may not expand to include:

And so on and so forth. If it turns out this program is useful, I might end up doing this stuff.

Anyway. Salutations. Have a nice day.