How to send/retrieve data on a STATIC site

Hey programmers!
I was wondering if there’s any way to send or retrieve info (really just form info) on a static site. If not, can you refer to a service that can do this for me? I’ve seen you can send data from a webhook into discord, but I’m looking for something that will show up on glitch, or on another platform.
Let me know!

1 Like

I use Netlify for deploying some of my sites and apps and they also have a good form service. It requires a bit of code setup but the documentation is easy to follow. Their forms will send messages directly to your inbox while also effectively weeding out spam.

As far as generally receiving and sending data from an API (get and post requests), you can use the Javascript Fetch API within a script on your page. Hope that’s helpful / answers your question!

3 Likes

If you use express, it is really easy.

Add the following line to the server after all require statements:

app.use(express.static(“public”));

More details - see http://expressjs.com/en/starter/static-files.html

Hi Dmitry… see “static site”. A site is no longer static if you add a server to the project. The server is always running.

1 Like

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.