Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save stewhouston/47351f03033ade89600132c45536c7e5 to your computer and use it in GitHub Desktop.
Save stewhouston/47351f03033ade89600132c45536c7e5 to your computer and use it in GitHub Desktop.
Express/TypeScript Manbearpig
var RouteController = require('./lib/RouteController');
@RouteController({
providers: ['express', 'mongoose']
})
class Dota2Controller {
baseUrl:string = '/dota2';
routes:any;
constructor(private express, private mongoose) {
this.routes = express.Router();
this.routes.get('/', (req, res) => {
res.status(200).send('yes it works');
});
this.routes.post('/submit', (req, res) => {
return res.render('foobar');
});
}
}
module.exports = Dota2Controller;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment