Given that the static folder has special meaning (e.g. it's used to determine what should go in the service worker manifest) it probably makes sense just to include sirv inside Sapper, rather than having it in the project template separately.
That way, the simplest possible Sapper server could look roughly like this:
import * as http from 'http';
import * as sapper from '@sapper/server';
http.createServer(sapper.middleware()).listen(process.env.PORT);
Its a great idea but we should be able to use other middlewares. We can also include http inside sapper.
````
import * as sapper from '@sapper/server';
import bodyParser from 'body-parser';
import helmet from 'helmet';
sapper.use(bodyParser.json())
sapper.use(helmet())
sapper.session((req, res) => ({
user: req.user
}))
sapper.start(process.env.PORT);
````
We can also try to replace http with https://github.com/uNetworking/uWebSockets.js which is much faster than node http.
Most helpful comment
We can also try to replace http with https://github.com/uNetworking/uWebSockets.js which is much faster than node http.