A simple and easy-to-use web server for managing Node.js projects.
- Automatic HTTPS
- HTTP/2 & SPDY
- WebSockets
- Easy Deployment from GitHub
- Process Managing
- Virtual Hosts
- Gzip
- Static Server
$ npm install easy-pm -g
Just create a configuration file on your server and easy-pm start it.
$ easy-pm start config.json
Basic example:
{
"root": "/var/www",
"ssl": {
"sites": {
"example.com": "auto",
"www.example.com": "auto"
}
},
"webhook": {
"host": "your server address",
"token": "your github token"
},
"apps": [
{
"name": "example",
"domains": ["example.com", "www.example.com"],
"repository": "[email protected]:your_github_id/example.git",
"max_memory_restart": "100M"
},
{
"name": "static-example",
"domains": ["static-example.com"],
"repository": "[email protected]:your_github_id/example.git",
"branch": "gh-pages"
}
]
}
- root - string The directory to put your applications.
- port - number optional. The port easy-pm running on. Default
80
. - gzip - boolean optional. Whether enable gzip for all applications. Default
true
. - ssl - object optional.
- port - number optional. The SSL port easy-pm running on. Default
443
. - disable_redirect - boolean optional. Disable redirecting
http
requests tohttps
for all sites. Defaultfalse
. - sites - object.
- [domain] - object | "auto" If
"auto"
, easy-pm will install and manage SSL certificate from Let's Encrypt automatically.- key - string The path of private key.
- cert - string The path of certificate.
- disable_redirect - boolean optional. Disable redirecting
http
requests tohttps
. Defaultfalse
.
- [domain] - object | "auto" If
- port - number optional. The SSL port easy-pm running on. Default
- webhook - object optional.
- host - string Address of your server.
- token - string GitHub token to access GitHub API.
- apps - [object] check out Application Configuration for available attributes.
- type - string optional. Can be "node", "static" or "custom". Default
"node"
. - name - string Application name.
- port - number optional. The port used by your application is passed as
env.PORT
. Default is a random free port. - gzip - boolean optional. Whether enable gzip for this application. Default
true
. - domains - [string] optional. Domains to access this application.
- repository - string Git address of this application.
- branch - string Branch to work on. Default
"master"
. - max_memory_restart - string optional. Maximum memory over which the application will be restarted, ends with "K", "M" or "G".
- env - object optional. Environment variables for this application.
In node mode, easy-pm will use npm start
to your application.
In static mode, easy-pm will run a static server to serve your application.
- root - string optional. Root path for the static server. Default
"./"
. - 404 - string optional. The file to return when resource not found with status 404. Default
"404.html"
. - fallback - string optional. Similar to
404
, but returns status 200. Used for some single page applications.
In custom mode, you can run other non-Node.js project and custom your scripts.
- script - string Path of file to execute.
- args - [string] optional. Arguments to pass to the script.
- interpreter - string The interpreter to execute the script.
- interpreterArgs - [string] optional. Arguments to pass to the interpreter.
$ easy-pm -h
Usage: easy-pm [options] [command]
Commands:
start <file> start service with config file
stop <file> stop service with config file
list list running applications
Options:
-h, --help output usage information
-V, --version output the version number
- Tests
- Hot Reloading
- Multi-core
- Travis CI
- NVM
MIT