Skip to content

Instantly share code, notes, and snippets.

@joshdcar joshdcar/app.ts Secret
Created Mar 1, 2017

Embed
What would you like to do?
/* Express Web Application - REST API Host */
import * as path from 'path';
import * as express from 'express';
import * as logger from 'morgan';
import * as bodyParser from 'body-parser';
import PhotoLocationRouter from './routes/PhotoLocationRouter';
class App{
public express: express.Application;
constructor(){
this.express = express();
this.middleware();
this.routes();
}
private middleware(): void{
this.express.use(logger('dev'));
this.express.use(bodyParser.json());
this.express.use(bodyParser.urlencoded({extended: false}));
}
private routes(): void{
let router = express.Router();
this.express.use('/api/v1/photolocations', PhotoLocationRouter);
}
}
export default new App().express;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.