You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
17 lines
410 B
17 lines
410 B
import sirv from 'sirv';
|
|
import polka from 'polka';
|
|
import compression from 'compression';
|
|
import * as sapper from '@sapper/server';
|
|
|
|
const { PORT, NODE_ENV } = process.env;
|
|
const dev = NODE_ENV === 'development';
|
|
|
|
polka() // You can also use Express
|
|
.use(
|
|
compression({ threshold: 0 }),
|
|
sirv('static', { dev }),
|
|
sapper.middleware()
|
|
)
|
|
.listen(PORT, err => {
|
|
if (err) console.log('error', err);
|
|
});
|