pinafore/src/server.js
Nolan Lawson fabf9399f2
fix: use static server for node server.js (#1041)
* fix: use static server for `node server.js`

Aligns the Node server with the Zeit server. Fixes #1019

* fix test
2019-02-23 16:09:48 -08:00

16 lines
435 B
JavaScript

// This is the Sapper server, which we only run during `sapper export`.
import * as sapper from '../__sapper__/server.js'
import express from 'express'
const { PORT = 4002 } = process.env
const app = express()
app.use(express.static('static'))
app.use(sapper.middleware())
app.listen(PORT, () => console.log(`listening on port ${PORT}`))
// Handle SIGINT (source: https://git.io/vhJgF)
process.on('SIGINT', () => process.exit(0))