Skip to content

Instantly share code, notes, and snippets.

@joshdcar

joshdcar/app.ts Secret

Created March 1, 2017 22:46
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save joshdcar/c8806cd46519f622643628360dc97d32 to your computer and use it in GitHub Desktop.
Save joshdcar/c8806cd46519f622643628360dc97d32 to your computer and use it in GitHub Desktop.
/* 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