-
-
Save omenking/a447769a9019124a47825ae2a708e7e4 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
// Direct Imports | |
const express = require("express"); | |
const winston = require("winston"); | |
// Instantiate express | |
const app = express(); | |
require("./startup/logging")(); | |
require("./startup/middleware")(app); | |
// require("./startup/config")(); | |
require("./startup/routes")(app); | |
require("./startup/db")(); | |
require("./startup/validation")(); | |
// PORT | |
const port = process.env.PORT || 5000; | |
const server = function() { | |
app.listen(port, () => { | |
winston.info(`Listening on port ${port}...`); | |
}); | |
} | |
module.exports = server; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I would wrap your server in a function.