This namespace exports a utility function for starting the server, and correctly handling signal like SIGHUP and SIGTERM.
import { startApp } from "@quintype/framework/server/start";
Methods
# static startApp(appThunk, opts)
This app starts a cluster with workers who listen for web requests
Parameters:
Name | Type | Description |
---|---|---|
appThunk |
function
|
A function which returns an express app when evaluated |
opts |
Object
|
Options that are passed to @quintype/build (in dev mode) |
workers |
number
|
The number of workers to be spawned (default 4) |
port |
number
|
The port to start on (default 3000) |
sleep |
number
|
Number of milliseconds to wait to respawn a terminated worker (default 250) |