Skip to content

HTTP.createServer then close after one connection #46

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
jamesdbrock opened this issue Nov 21, 2022 · 2 comments
Closed

HTTP.createServer then close after one connection #46

jamesdbrock opened this issue Nov 21, 2022 · 2 comments

Comments

@jamesdbrock
Copy link
Member

I want to close an HTTP server after one connection. It seems to be impossible? The variable server is not defined at close server.

  server <- createServer \request response -> do
    respond request response
    close server (pure unit)

It looks like this is impossible because the Node.js API is bad. createServer is just a wrapper for the Node.js http.createServer function. But still.

@jamesdbrock
Copy link
Member Author

Ok I see, we're missing the onRequest event. That's what we need.

@jamesdbrock jamesdbrock mentioned this issue Nov 21, 2022
4 tasks
@jamesdbrock jamesdbrock linked a pull request Nov 21, 2022 that will close this issue
4 tasks
@jamesdbrock jamesdbrock mentioned this issue Jun 19, 2023
4 tasks
@JordanMartinez
Copy link
Contributor

Fixed by #49.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants