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