Skip to content

Instantly share code, notes, and snippets.

@pmhegdek
Last active March 3, 2019 11:46
Show Gist options
  • Save pmhegdek/82052cb064327ea091ac881e072e51cb to your computer and use it in GitHub Desktop.
Save pmhegdek/82052cb064327ea091ac881e072e51cb to your computer and use it in GitHub Desktop.
src/App.ts
import * as express from 'express'
class App {
public express
constructor() {
this.express = express()
this.loadRoutes()
}
private loadRoutes() : void {
const router = express.Router()
router.get('/', (req, res) => {
res.json({
'message': 'Hello World!'
})
});
this.express.use('/', router);
}
}
export default new App().express;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment