Skip to content

Instantly share code, notes, and snippets.

@greduan
Created September 13, 2017 20:12
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 greduan/89b60d008f15cebaee5ec45c382e557d to your computer and use it in GitHub Desktop.
Save greduan/89b60d008f15cebaee5ec45c382e557d to your computer and use it in GitHub Desktop.
Just a starter server that I've seen myself writing several times now
const path = require('path')
const express = require('express')
const morgan = require('morgan')
const app = express()
app.set('x-powered-by', false)
app.set('view engine', 'ejs')
app.set('views', path.resolve(__dirname, '..', 'views'))
app.use('/assets', express.static(path.resolve(__dirname, '..', 'build')))
app.use(morgan('tiny'))
app.get('/', (req, res) => res.render('index'))
app.listen(8000, () => console.log('Listening on :8000'))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment