import express = require ( 'express' ) ; import cors = require ( 'cors' ) ; import bodyParser = require ( 'body-parser' ) ; import { Dino } from '../../../index' ; import { HomeController } from './controllers/home.controller' ; import { ServerParseErrorMiddleware } from './middlewares/filters' ; import { AboutController } from './controllers/about.controller' ; const app = express ( ) ; const port = process . env . PORT || 8088 ; app . use ( bodyParser . urlencoded ( { extended : true } ) ) ; app . use ( bodyParser . json ( ) ) ; app . use ( cors ( ) ) ; let dino = new Dino ( app , '/api' ) ; dino . useRouter ( ( ) => express . Router ( ) ) ; dino . registerController ( HomeController ) ; dino . registerController ( AboutController ) ; dino . serverError ( ServerParseErrorMiddleware ) ; dino . bind ( ) ; app . listen ( port , ( ) => console . log ( `Server started on port ${ port }` ) ) ;