-
-
Save joshdcar/c8806cd46519f622643628360dc97d32 to your computer and use it in GitHub Desktop.
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
/* 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