Skip to content

open-website-status/provider

Repository files navigation

Open Website Status provider

npm

This is the CLI provider for Open Website Status

Usage

Install using:

npm i @open-website-status/provider -g

After installing, you can use the terminal command:

ows-provider

The configuration can be provider in the following ways:

  • As a command parameter
ows-provider -t MY_TOKEN -s http://example.com:1234
  • Set in the config
ows-provider config-set token MY_TOKEN
ows-provider config-set server http://example.com:1234
  • Passed as an environmental variable
  • Provided in a .env file (using the same key as the Environmental variable)
OWS_TOKEN=MY_TOKEN
OWS_SERVER=http://example.com:1234

If you provide the setting in multiple ways (eg. as a command line parameter and as an environmental variable) the priority is the same as the order of the list above

Command argument Config key Environmental variable Description Required Default
-t, --token TOKEN token OWS_TOKEN Provider token YES
-s, --server URL server OWS_SERVER Backend server URL no https://api.open-website-status.com
-p, --path PATH path OWS_PATH Provider socket path no /provider-socket

Running as a service

If you want to run the script as a service you can use a tool such as pm2.

Install pm2 using

npm i -g pm2

You can then start the service using

pm2 start ows-provider

To stop it just run

pm2 stop ows-provider

NOTE: for some reason this doesn't work on Windows. Check Unitech/pm2#2037 for more details.

Check this pm2 guide for instructions to start the service on system boot.