Closed mietek closed 10 years ago
Hrm... That is supposed to be correct. I copy pasted that code into a file and ran it (with -XOverloadedStrings), and it worked. Here is the output from curl -D /dev/stdout localhost:3000
:
HTTP/1.1 200 OK
Transfer-Encoding: chunked
Date: Mon, 10 Nov 2014 16:44:19 GMT
Server: Warp/3.0.2.3
Content-Type: text/plain
Hello, world!
What are you getting? Could you cabal freeze
your dependencies so i can try to reproduce with your exact environment?
Thanks!
I am getting:
HTTP/1.1 200 OK
Transfer-Encoding: chunked
Date: Mon, 10 Nov 2014 19:48:56 GMT
Server: Warp/3.0.2.3
Content-Type: text/html
Hello, world!
My dependencies are already frozen. In fact, if you have a Heroku account, you should be able to reproduce the problem within 30 seconds. Please look at hello-simple.
I think you may have forgotten to commit your changes before deploying or something. The code you referenced uses okHtml
, not ok "text/plain"
as in your example. I just pulled your code, made the change in your example and deployed to heroku and am getting the expected result:
$ curl -D /dev/stdout https://enigmatic-savannah-4828.herokuapp.com/
HTTP/1.1 200 OK
Connection: keep-alive
Transfer-Encoding: chunked
Date: Mon, 10 Nov 2014 20:56:24 GMT
Server: Warp/3.0.2.3
Content-Type: text/plain
Via: 1.1 vegur
Hello, world!
My fork of the code is here: https://github.com/alevy/hello-simple
My apologies! You are right.
What is the right way to get
text/plain
output, instead oftext/html
? The following code does not work properly:Resolving this question would help me add hello-simple to a growing collection of Haskell web application deployment examples.