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.
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.
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,
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 alwayshtml
.