1.0.4 • Published 12 months ago

hs3 v1.0.4

Weekly downloads
-
License
MIT
Repository
github
Last release
12 months ago

hs3

Create a daemon http server by one command.

A tool to create daemon http/https static files server

Key features

  1. running background
  2. auto restart service after linux/windows reboot
  3. very fast, no hack, easy to use, just works!

How to use

npm install -g hs3

# move to the directory which you want to serve as static files 
hs3

Custom config

If you want custom configuration, create a hs3.config.json in the same directory.

Content example

{
  "port": 3000,
  "cert": "./relative-path-to-cert-file",
  "key": "./relative-path-to-key-file"
}
keynameDescription
portthe port you want to use
cert, keyIf 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

{
  "port": 3000
}

How to restart service after linux/windows reboot

hs3 use pm2 to run as background task. So type following scripts to enable restart after reboot

#skip this step if you already installed pm2
npm install -g pm2

# restart after reboot
pm2 startup
pm2 save

Related link

1.0.4

12 months ago

1.0.3

12 months ago

1.0.2

12 months ago