Last active
March 3, 2019 11:46
-
-
Save pmhegdek/82052cb064327ea091ac881e072e51cb to your computer and use it in GitHub Desktop.
src/App.ts
This file contains 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 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