Created
October 4, 2017 11:33
-
-
Save Pierre-RA/254ad481f60e986cd733769a4e5afa96 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
import * as express from 'express'; | |
import * as dotenv from 'dotenv'; | |
import * as bodyParser from 'body-parser'; | |
import * as homeController from './controllers/home.controller'; | |
dotenv.config(); | |
const app = express(); | |
app.set('port', process.env.PORT || 3000); | |
app.use(bodyParser.json()); | |
app.use(bodyParser.urlencoded({ extended: true })); | |
app.get('/', homeController.index); | |
app.listen(app.get('port'), () => { | |
console.log(('App is running at http://localhost:%d in %s mode'), | |
app.get('port'), app.get('env')); | |
console.log('Press CTRL-C to stop\n'); | |
}); | |
module.exports = app; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment