Would sending GET requests to my glitch project return a result even if my page is offline/sleeping?

title
Would sending GET requests to my glitch project return a result even if my page is offline/sleeping?
Im trying to make a website that I can access using my NPM package so people using my package don’t have to download certain dependencies.

I doubt it would show the results from your site if its loading

But if its an API such as node-fetch thats fetching it, would it be a different story?

still doubt it as your site technically isn’t on when its waking up

Commands Like Curl and many Programming Languages Will Wait for a Response In many of Those you can set a Timeout period that is how long it will wait for a response before it closes the Connection
When Your Project Gets a request POST or GET and anything in between
It will wake Up automatically and start processing your Request it just may take upto a Minute For your project to boot before you get a response

Hope that helps

2 Likes

You’d get an HTML page with that “waking up” message. That’s consistent with what happens when you visit a sleeping project in a browser. Supposedly (reference Opt out of "Waking up" interstitial) if you set a content-type [sic] request header it instead waits for the project to boot and has the project respond.

2 Likes

Do you know what/how to set Content-Type to? I tried setting Content-Type: application/json and also Accept: application/json in my HTTP request header but still not working. I’m getting “waking up” HTML page.

I’m trying to call an API which is hosted on Glitch from my Express + Node.js app (which is also on Glitch).

There is no way to keep your project online 24/7 (ie. prevent the html waking up screen), sorry, unless you have boosted apps.

I never went down that path. I ended up restructuring my API so that a client would normally first send a POST \:

OK. I’m using an API which is not my own so I may have to find other API to avoid this issue. Thank you for replying anyway :slightly_smiling_face:

I’m building a media app using electron, and need to use glitch as an optional media provider backend. I might have to do the old invsible iframe trick…