Make it easier to start a static project


#1

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


#2

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


#3

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


#4

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.


#5

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


#6

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


#7

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)


#8

@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