Native http has a close() function https://nodejs.org/api/http.html#http_server_close_callback which stops the server from accepting new connections. This is necessary for graceful shutdown of node server.
You have access to the underlying native server.
const app = polka();
// start it at some point
app.listen(PORT);
//~> this is calling 'app.server.listen' under the hood
// shut it down manually
app.server.close();
Most helpful comment
You have access to the underlying native server.