Last active
January 27, 2019 21:23
-
-
Save seanpmaxwell/c449389411e0cc728799a43315f64239 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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