Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
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
You can’t perform that action at this time.