Pinafore-Web-Client-Frontend/src/server.js

16 lines
529 B
JavaScript
Raw Permalink Normal View History

// This is the Sapper server, which we only run during `sapper export`.
import * as sapper from '../__sapper__/server.js'
import express from 'express'
2018-01-07 00:51:25 +01:00
2018-02-09 07:29:29 +01:00
const { PORT = 4002 } = process.env
const app = express()
2018-01-07 00:51:25 +01:00
app.use(express.static('static'))
app.use(sapper.middleware())
2018-01-07 00:51:25 +01:00
app.listen(PORT, () => console.log(`listening on port ${PORT}`))
// Handle SIGINT (source: https://github.com/pouchdb/pouchdb-server/blob/fdc6ba7/packages/node_modules/pouchdb-server/lib/index.js#L304-L306)
process.on('SIGINT', () => process.exit(0))