Skip to content

Instantly share code, notes, and snippets.

@seanpmaxwell
Last active January 27, 2019 21:23
Show Gist options
  • Save seanpmaxwell/c449389411e0cc728799a43315f64239 to your computer and use it in GitHub Desktop.
Save seanpmaxwell/c449389411e0cc728799a43315f64239 to your computer and use it in GitHub Desktop.
import * as bodyParser from 'body-parser'
import { Server } from '@overnightjs/core'
import { UserController } from './UserController'
import { LoginController } from './LoginController'
export class SampleServer extends Server {
constructor() {
super();
this.app.use(bodyParser.json());
this.app.use(bodyParser.urlencoded({extended: true}));
let loginController = new LoginController();
let userController = new UserController();
super.addControllers([loginController, userController]);
}
public start(port: number) {
this.app.listen(port, () => {
console.log('Server listening on port: ' + port);
})
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment