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() |
Beta Was this translation helpful? Give feedback.
3 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
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:http
also has a server close method.Beta Was this translation helpful? Give feedback.
All reactions