Skip to content

Instantly share code, notes, and snippets.

@Archakov06
Created January 3, 2018 21:17
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Archakov06/e373914727efeb0a4e43561c098865b6 to your computer and use it in GitHub Desktop.
Save Archakov06/e373914727efeb0a4e43561c098865b6 to your computer and use it in GitHub Desktop.
// config.js
const merge = require('lodash').merge;
const config = {
// Common configuration section
sentry: {
url: 'https://',
},
mongodbUri: 'mongodb://',
url: global.hasOwnProperty('location') ? global.location.origin + '/' : '',
port: process.env.PORT || 80,
};
module.exports = config;
// http.js
import { createServer } from 'http';
import app from './app';
import runSocket from './socket';
import config from '../../../config';
const server = createServer(app);
runSocket(server);
server.listen(config.port, () => {
console.log(`HTTP server started ${config.port} port!`);
});
export default server;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment