Created
September 13, 2017 20:12
-
-
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
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
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