akirikovich / html-server

2 stars 1 forks source link

Get rid of the config.json #6

Closed vitkarpov closed 5 years ago

vitkarpov commented 10 years ago

So, what is it all about.

I found that server.config.json is really overwhelming. Common project structure for html-guy is "all content in one folder": css, js, fonts, dummy, ... , index.html, news.html, ...

So, it's really convenient to specify just a basepath for all that stuff. And this data could be retrieved from the CLI.

For instance,

$ node ./node_modules/html-server/server.js -port=8000 -basepath=build/

In this case server will resolve all absolute paths '/' relative to the specified basepath. It works like unix's cd.

If you set -basepath=build/ it would be resolved relative to the current local folder (folder with your project, where server's running), and -basepath=/build/ would be resoved to the root of your filesystem.

Also, I think that rule /:page for router is one possible, and it's not necessary to specify ext for pages — it's always html.

vitkarpov commented 10 years ago

Let's discuss it. If it will be merged, I'll update the README

vitkarpov commented 5 years ago

I guess irrelevant PR :-) No problem!