node-server
node-server copied to clipboard
Unix domain socket support
It seems that you can fill the socket's path directly in the port:
const app = new Hono;
const uds = '/var/run/foobar.sock';
if (fs.existsSync(uds)) {
fs.unlinkSync(uds);
}
serve({
fetch: app.fetch,
hostname: 'localhost',
port: uds as any,
});
fs.chmodSync(uds, 666);