Do not attach 'request' listener if custom http server is provided
See original GitHub issueWhen I’m passing a custom HTTP server to Logux I would like to have full control over my routes.
import { Server as LoguxServer } from '@logux/server'
import http from 'http'
import polka from 'polka'
const server = http.createServer()
const app = polka({ server })
app.get('/status', (req, res) => res.end('OK'))
const loguxServer = new LoguxServer()
app.listen()
await loguxServer.listen()
This doesn’t work and I have to detach it manually.
await loguxServer.listen()
let [polkaListener, loguxListener] = server.listeners('request')
server.off('request', loguxListener as any)
https://github.com/logux/server/blob/main/base-server/index.js#L400
Issue Analytics
- State:
- Created a year ago
- Comments:6 (4 by maintainers)
Top Results From Across the Web
http.server — HTTP servers — Python 3.11.1 documentation
BaseHTTPRequestHandler provides a number of class and instance variables, and methods for use by subclasses. The handler will parse the request and the...
Read more >How To Make an HTTP Server in Go | DigitalOcean
In this tutorial, you will create an HTTP server using Go's standard library and then expand your server to read data from the...
Read more >Configure HTTP Listener Source - Mule 4
The Anypoint Connector for HTTP (HTTP Connector) Listener source enables you to set up an HTTP server and trigger flows when receiving HTTP...
Read more >HttpServer (Java HTTP Server ) - Oracle Help Center
This class implements a simple HTTP server. A HttpServer is bound to an IP address and port number and listens for incoming TCP...
Read more >HTTP | Node.js v19.3.0 Documentation
Emitted each time a server responds to a request with a CONNECT method. If this event is not being listened for, clients receiving...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
We can add
ignoreNonWsRequest
(I will think about a better name) to Server options.Another way to test it just to copy-paste files from the repo to
node_modules/@logux/server