paf31/purescript-rest

Example fails when making a request

Opened this issue · 4 comments

I cloned the repo, did bower install. When I go to localhost:8080 or 8081, I get a response back but the server also dies with the message below. The "Listening on port 8080" also prints only when I make the request. node version v0.12.2.

> pulp test
* Building project in /Users/antti/code/purescript/purescript-rest
* Build successful. Running tests...
The API tester is configured to send requests to localhost:9000/api.
To avoid CORS issues in the browser, you should forward requests from port 9000 to 8080/8081 accordingly.

Listening on port 8080.
Serving docs on port 8081.
/Users/antti/code/purescript/purescript-rest/output/Node.Stream/foreign.js:125
                f();
                ^
ReferenceError: f is not defined
    at ServerResponse.<anonymous> (/Users/antti/code/purescript/purescript-rest/output/Node.Stream/foreign.js:125:17)
    at ServerResponse.g (events.js:199:16)
    at ServerResponse.emit (events.js:104:17)
    at finish (_http_outgoing.js:521:10)
    at afterWrite (_stream_writable.js:361:3)
    at _stream_writable.js:349:9
    at process._tickCallback (node.js:355:11)
* ERROR: Subcommand terminated with error code 1
paf31 commented

Hmm, I'm running on an even older version of Node, and it seems to run fine from a fresh install for me.

Thanks for the report, I'll look into it.

paf31 commented

Actually, it looks like this was an FFI issue in node-streams. Could you please try again? I'll tag another release.

It works now and doesn't crash. But it still prints the "Listening on port 8080" after I've requested something. Is this intended?

paf31 commented

No, that's not intended, and it works differently for me. I'll look into that too. Thanks!