Skip to content

Instantly share code, notes, and snippets.

@ddialar
Last active August 7, 2017 20:06
Show Gist options
  • Save ddialar/8ff1300495a5e2084859320e85e0d5ce to your computer and use it in GitHub Desktop.
Save ddialar/8ff1300495a5e2084859320e85e0d5ce to your computer and use it in GitHub Desktop.
log4js - Server file including the Log4JS module.
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