Skip to content

Instantly share code, notes, and snippets.

Created May 30, 2021
What would you like to do?
sapper POST setting
import sirv from 'sirv';
import polka from 'polka';
import compression from 'compression';
import * as sapper from '@sapper/server';
const { json } = require('body-parser');
const { PORT, NODE_ENV } = process.env;
const dev = NODE_ENV === 'development';
polka() // You can also use Express
compression({ threshold: 0 }),
sirv('static', { dev }),
.listen(PORT, err => {
if (err) console.log('error', err);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment