Repository navigation
Replies: 1 comment 3 replies
|
Easiest way is this: import { App } from '@tinyhttp/app'
import { createServer } from 'http'
const app = new App()
const server = createServer((req, res) => {
app.attach(req, res)
}).listen(3000)
if (something) server.close() |
3 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment

Uh oh!
There was an error while loading. Please reload this page.
How do I stop listening on a port after I've started my server? In Express there seems to be a
server.close()function (see graceful shutdown docs) but I don't see anything related to this in tinyhttp.node:httpalso has a server close method.All reactions