Make it easier to start a static project

Might be useful to add https://glitch.com/edit/#!/static-start or something similar to “hello world” / “building blocks”.

1 Like

Thanks, you read our minds! We’re currently working on a few ways to make starting static sites easier.

2 Likes

You can also use Python to be able to keep your package.json (so you can install dependencies) and serve the site statically: https://glitch.com/edit/#!/python-static-site

Feels like https://www.npmjs.com/package/http-server would be a better option. SimpleHTTPServer’s single threaded blocking nature can create a load of weird behaviours and bugs.

1 Like

@jaffathecake you are absolutely right. I created the project for testing only. Regarding http-server it is a great solution!

I found that for static serving you could use: /etc/app-types/static/start.sh like here: https://glitch.com/edit/#!/static-server which uses local-web-server

For a static site, you don’t need a package.json file at all, it will fallback to using local-web-server without it (https://glitch.com/faq#server)

1 Like

@Gareth I know that if I remove package.json my project becomes a static site (launched through local-web-server). But I wanted to keep my package.json in order to be able to install some dependencies to my static site (like lodash), and even be able to build my site using post-install for an angular or babel site.

Btw, I’m also aware I could add dependencies to my static site through https://unpkg.com, but I wanted to add some through package.json

1 Like