Created
January 3, 2018 21:17
-
-
Save Archakov06/e373914727efeb0a4e43561c098865b6 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
// 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