Created
June 16, 2020 10:46
-
-
Save rezaindrag/8c2e64ed650f44c834b5675f3fccefa9 to your computer and use it in GitHub Desktop.
Initiate Server
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
const express = require("express"); | |
const fs = require("fs"); | |
const app = require("./app"); | |
const server = express(); | |
// Load file config.json | |
const file = fs.readFileSync("./config.json"); | |
const config = JSON.parse(file); | |
// Initiate config | |
app.init(server, config); | |
server.listen(config.server.port, function(err) { | |
if (err) throw err; | |
console.log("Server is running"); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment