Last active
August 7, 2017 20:06
-
-
Save ddialar/8ff1300495a5e2084859320e85e0d5ce to your computer and use it in GitHub Desktop.
log4js - Server file including the Log4JS module.
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 log4js from 'log4js'; | |
var logger = log4js.getLogger('server.js'); | |
logger.level = 'all'; | |
import { serverConf } from './config'; | |
import express from 'express'; | |
import bodyParser from 'body-parser'; | |
var app = express(); | |
app.use(bodyParser.json()); | |
app.use(bodyParser.urlencoded({ extended: true })); | |
app.post( | |
'/signin', | |
(request, response) => { | |
response.json(request.body); | |
} | |
); | |
app.listen( | |
serverConf.port, | |
() => { | |
logger.info(`Server running on port ${serverConf.port} ...`); | |
// console.log(`Server running on port ${serverConf.port} ...`); | |
} | |
); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment