Skip to content

Instantly share code, notes, and snippets.

View codevenkat's full-sized avatar

codevenkat

View GitHub Profile
@codevenkat
codevenkat / server.js
Created January 17, 2018 11:27
Example of having server in separate file express.js
//ES6(ES2015) used
const express = require('express')
const http = require('http')
const app = require('./server/app')
const port = process.env.PORT || 8080
const server = http.createServer(app)
server.listen(port, () => {
console.log(`App started. Listening on port:${port}`)