Skip to content

Instantly share code, notes, and snippets.

@rezaindrag
Created June 16, 2020 10:46
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 rezaindrag/8c2e64ed650f44c834b5675f3fccefa9 to your computer and use it in GitHub Desktop.
Save rezaindrag/8c2e64ed650f44c834b5675f3fccefa9 to your computer and use it in GitHub Desktop.
Initiate Server
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