A tool to create daemon http/https static files server
npm install hs3
Create a daemon http server by one command.
A tool to create daemon http/https static files server
shell
npm install -g hs3move to the directory which you want to serve as static files
hs3
`$3
If you want custom configuration, create a hs3.config.json in the same directory.Content example
`json
{
"port": 3000,
"cert": "./relative-path-to-cert-file",
"key": "./relative-path-to-key-file"
}
`| keyname | Description |
|-----------|------------------------------------------------------------------------------------------|
| port | the port you want to use |
| cert, key | If you set both cert and key file path, then will serve with https, else serve with http |
If you don't create the json file, the default config is
`json
{
"port": 3000
}
`
$3
hs3 use pm2 to run as background task. So type following scripts to enable restart after reboot
`shell
#skip this step if you already installed pm2
npm install -g pm2restart after reboot
pm2 startup
pm2 save
``