I believe I’ve seen it on some Heroku buildpacks for static content. It will make it easy for people to setup their static sites on Glitch without messing with
server.js and learning a lot of details about NPM, Node.js, serving requests etc.
"Strict-Transport-Security": "max-age=31536000; includeSubdomains;"
To serve a static site you can currently just remove make sure package.json is deleted from the project. The static server kicks on automatically.
On that note it might be a good idea to mention this fact in the default README.md.
I think @techtonik wants to be able to specify headers and the other features in the static.json file.
Well, yes. Our https://github.com/gratipay/grtp.co is a static site, but it is build by JS tools from
package.json, so removing it is not an option.
It’s not the cleanest solution and doesn’t account for the Strict-Transport-Security you’ve specified in your static.json though so it may not work for this particular project…but, if anyone else is experiencing a similar issue and wants to use Glitch the fastest workaround without having to completely delete package.json would be to update the
start script in package.json.
"start": "ws --port 3000 --directory ./www --forbid '/.env' --forbid '/.data' --log-format combined",