Home

Awesome

template

Features

Usage

install required modules

npm install --save @zbryikt/template

start server ( -r, -p and -c are optional ):

npx server -r <your-web-root> -c <your-server-config> -o <auto-open:true/false> -p <port>

you can also add following in your own package.json:

"scripts": {
    "start": "npx server"
},

optional server config json file specified via -c option for altering default port and other config:

{ "port": 3012 }

Port will be randomized unused port if not specified. For more about options, see the Options section below.

Start Kit

sample folder serves as a starting point to bootstrap a project. It contains following files:

Custom API

run template with customized web api by manually initing server:

require("template")
template.server.init({
    api: function(server) {
        server.app.get("/custom-api", function(req, res) {
            return res.send("custom api response");
        });
    }
});

in this case you will have to watch source files manually:

template.watch.init({ ... });

Options

server.init accepts config with following options:

for using @zbryikt/template as a command line tool, config file specified by -c option also support following options:

watch.init accepts config with following options:

Additional information

template now use @plotdb/srcbuild for source building, and thus there are some additional features available and documented in @plotdb/ssrcbuild. Please refer to @plotdb/srcbuild for more information.

TODO

Note

License

MIT