osseus-server

0.1.4 • Public • Published

JavaScript Style Guide

Osseus Server

express based osseus web server module

Install

$ npm install osseus-server

Usage

Configuration

Mandatory:

  • OSSEUS_SERVER_PORT

Optional:

  • REQUEST_ID_HEADER
  • MAINTENANCE_ENABLED
    • set to true to enable maintenance mode on server
  • MAINTENANCE_MESSAGE
    • maintenance message sent to clients when maintenance mode is enabled
  • MAINTENANCE_OVERRIDE_HEADER
    • bypass maintenance mode with this header
  • ALLOWED_IP
    • list of ip addresses allowed to bypass maintenance mode
  • COMPRESION_ENABLED
  • COMPRESSION_LEVEL
  • NO_COMPRESSION_HEADER
    • don't compress responses with this request header
  • MORGAN_FORMAT
  • CORS_WHITELIST
  • STATIC_ENGINE_TYPE
  • VIEWS_FOLDER
  • STATIC_FOLDER
  • ADD_HEALTHCHECK
    • add /healthcheck endpoint which returns OK with status code 200
  • ADD_IS_RUNNING
    • add /is_running endpoint which returns OK with status code 200

Example

First, create index.js:

const Osseus = require('osseus')

const main = async () => {
	try {
		// init osseus
		const osseus = await Osseus.init()
  	} catch (err) {
		console.error(err)
  	}
}

main()

Running:

$ node index.js --OSSEUS_SERVER_PORT 8080

Will result in:

server is listening on port: 8080

Contributing

Please see contributing guidelines.

License

Code released under the MIT License.

Dependents (0)

Package Sidebar

Install

npm i osseus-server

Weekly Downloads

1

Version

0.1.4

License

MIT

Unpacked Size

14.5 kB

Total Files

9

Last publish

Collaborators

  • liorrabin