Proton

Proton Command-Line

Proton includes the command-line program proton, which is used to run web apps created with any proton compatible framework.

This can be used during development, as well as by init scripts to run your web app in production.

Usage

Most of the time you will be running proton while developing a web application.

If you place your web app in your project in lib/webapp.js (which is the convention), then you can run your webapp from the root directory by running:

proton

This starts a server listening on port 8000 running in the foreground. Proton also accepts command-line options to alter this default behaviour. For example, to change the port that the server will listen on to 8080:

proton --port 8080

Development

While developing your project, your application will change continously.

Rather than having to stop and restart proton each time, you can use the -r argument to hot reload your JavaScript files every time your application receives a request.

proton -r

This argument is designed for development only, in production it will affect the performance of your application.

Command-Line Options

Path

--webapp -w PATH relative path to the module containing the webapp (default lib/webapp.js).

Port

--port -p NUMBER the port to listen on (default 8000).

Pidfile

--pidfile -P PATH file that the web app's PID should be written to.

Logdir

--logdir -l PATH folder where logs should be written to.

Uid

--uid -u IDENTIFIER username or uid that the web app should run as.

Gid

--gid -g IDENTIFIER group name or gid that the web app should run as.

Silent

--silent -s run without sending output to the terminal.

Daemonise

--daemonise -d detach from the terminal and deamonise after starting.

Reload

--reload -r automatically pick up changes (do not use in production).

Help

--help -h display all arguments.