@dollarshaveclub/nodejs-server
v2.10.0
Published
[](https://circleci.com/gh/dollarshaveclub/nodejs-server/tree/master) [
Options:
name- name of the repoportsocketTimeoutgracefulShutdownTimeoutrollbarPostServerItemAccessToken
For development only:
proxy = false- whether to proxy requestsproxyHostname = process.env.PROXY_HOSTNAME || release.dollarshaveclub.com- what server to proxyproxyMatch = /^\/(api|cms|face-assets)\//- regex to match paths to proxy
To support proxying locally and internationally, add the following to your /etc/hosts:
::1 localhost # should have already been added
::1 localhost.au
::1 localhost.ca
::1 localhost.ukExpress
const serve = require('@dollarshaveclub/nodejs-server')
const app = require('express')()
// app logic
serve(app, {
name: 'my-app',
}).then(({ port }) => {
console.log(port)
})Koa
const serve = require('@dollarshaveclub/nodejs-server')
const Koa = require('koa')
const app = new Koa()
// app logic
serve(app, {
name: 'my-app'
})Typescript w/ Koa
import serve from "@dollarshaveclub/nodejs-server"
await serve(new Koa(), {name: "my-app"})