Home > @infiniteobjects/express-server > Server
Server Class
Signature:
export declare class Server
| Constructor | Modifiers | Description |
|---|---|---|
| (constructor)(config) | Constructs a new instance of the Server class |
| Property | Modifiers | Type | Description |
|---|---|---|---|
| app | readonly |
Express | Express server instance |
| errorHandlers | ErrorRequestHandler[] | Error middleware to add to the request | |
| log | readonly |
LoggerInstance | A Logger instance |
| name | readonly |
string | Server name |
| parseBody | boolean | Body Parsing | |
| port | readonly |
number | Port we are listening for |
| post | RequestHandler[] | Middleware to add to the request after the route handlers. | |
| pre | RequestHandler[] | Middleware to add before the route handlers. A good example is loadUser |
|
| routes | RouteConfig[] | The routes for this server | |
| server | readonly |
http.Server | NodeJS server |
| staticPaths | IStaticPath[] | Static paths to serve (MUST BE ABSOLUTE PATHS) | |
| version | readonly |
string | Server version |
| Method | Modifiers | Description |
|---|---|---|
| init() | ||
| initSentry(dsn) | Initializes Sentry on the app | |
| listen() | Start listening for requests | |
| printConfig() |