2019-02-24 00:09:48 +00:00
|
|
|
// This is the Sapper server, which we only run during `sapper export`.
|
|
|
|
|
2018-12-11 15:31:48 +00:00
|
|
|
import * as sapper from '../__sapper__/server.js'
|
2019-02-15 03:39:24 +00:00
|
|
|
import express from 'express'
|
2018-01-06 23:51:25 +00:00
|
|
|
|
2018-02-09 06:29:29 +00:00
|
|
|
const { PORT = 4002 } = process.env
|
2019-02-15 03:39:24 +00:00
|
|
|
const app = express()
|
2018-01-06 23:51:25 +00:00
|
|
|
|
2019-02-24 00:09:48 +00:00
|
|
|
app.use(express.static('static'))
|
|
|
|
app.use(sapper.middleware())
|
2018-01-06 23:51:25 +00:00
|
|
|
|
2019-02-24 00:09:48 +00:00
|
|
|
app.listen(PORT, () => console.log(`listening on port ${PORT}`))
|
2018-05-25 02:59:48 +00:00
|
|
|
|
|
|
|
// Handle SIGINT (source: https://git.io/vhJgF)
|
2019-02-24 00:09:48 +00:00
|
|
|
process.on('SIGINT', () => process.exit(0))
|