I've seen people try .close() but close doesn't seem to be a method in the Express library.
CodePudding user response:
Express' .listen()
method return an http.Server
instance that can be closed:
const express = require('express');
const app = express();
const server = app.listen(…);
…
server.close();