-
Notifications
You must be signed in to change notification settings - Fork 122
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
Resoinse doesn't work with string, which len <=5 #40
Comments
What kind of error do you get? |
No error. In my nim code I have this:
or curl does nothing with the first variant. Recieves nothing. On 29/07/15 17:23, Christine Dodrill wrote:
|
Can you show me all of your code? |
No, I cannot, but you need only this: and try with "12345" you'll recieve nothing On 30/07/15 00:27, Dominik Picheta wrote:
|
Your code is wrong. You need to lead routes with a slash. # example.nim
import jester, asyncdispatch, htmlgen
routes:
get "/":
resp h1("Hello world")
post "address/blablabla/ololo":
resp "12345"
runForever() $ curl -XPOST --data '' http://127.0.0.1:5000/address/blablabla/ololo
<html xmlns="http://www.w3.org/1999/xhtml"><head><title>404 Not Found</title></head><body style="text-align: center;"><h1>404 Not Found</h1><hr/><p>Jester 0.1.0</p></body></html> When I changed it to # example.nim
import jester, asyncdispatch, htmlgen
routes:
get "/":
resp h1("Hello world")
post "/address/blablabla/ololo":
resp "12345"
runForever() $ curl -XPOST --data 'magic' http://127.0.0.1:5000/address/blablabla/ololo
12345 The only bug here is that jester allows the user to define illegal routes. |
look: settings: post "/letters/photos/?": I'll not work at all if I write it like you, but it doesn't work, On 30/07/15 09:31, Christine Dodrill wrote:
|
Just try it yourself On 30/07/15 09:31, Christine Dodrill wrote:
|
I have posted code samples showing the exact cases you say are broken and shown otherwise. |
It's not leading "/". I had it in all of my routes. Do you understand me? I have this code: import jester, asyncdispatch settings: routes: I have no response. Also you are using another curl command. On 30/07/15 18:24, Christine Dodrill wrote:
|
does your machine have the IP address 123.123.123.123? |
No, I cannot give you real address, but you can use localhost, On 30/07/15 22:46, Christine Dodrill wrote:
|
We need more information. Show us exactly the commands you are executing (for curl especially) and the output that you are getting from those commands (from curl as well as your app). |
# issue40.nim
import jester, asyncdispatch, htmlgen
settings:
port = Port(5005)
bindAddr = "127.0.0.1"
routes:
get "/":
resp h1("Hello world")
post "/letters/photos/?":
resp "12345"
runForever()
$ curl -XPOST --data 'magic' http://127.0.0.1:5005/letters/photos
12345
$ curl -XPOST --data 'magic' http://127.0.0.1:5005/letters/photos/
12345 Can you run that nim file with those exact commands and paste all relevant output as I have? |
What operating system are you both using? |
|
@luntik2012 please provide me with the same information as @Xe. |
Nim Compiler Version 0.11.2 (2015-06-30) [Linux: amd64] git hash: 45b6082c12dd6fc90a3dd3ca97e1ba157c3d6464 Linux myhost 3.19.0-15-generic #15-Ubuntu SMP Thu Apr 16 23:32:37 UTC On 30/07/15 22:56, Dominik Picheta wrote:
|
All the information |
There is all my code. In one file:
math, os, asyncnet, db_mysql
It was compiled by a command: Then I run command AAA(I'll place it in the end of this post) and get And this form AAA command: The AAA command (in one string): On 30/07/15 23:01, Dominik Picheta wrote:
|
Can confirm with the code in this gist. Changing it to return |
In my case it returns 12346 if it is in "resp", On 30/07/15 23:18, Christine Dodrill wrote:
|
@luntik2012 This is why it's important to tell us all the information. We had no idea what your |
I've sent you my curl command On 30/07/15 23:21, Dominik Picheta wrote:
|
Now you have. But it took you a long time to send it to us. |
I'm trying this
resp "12345"
and this
resp "123456"
Only the second one works.
Also I'm not sure I have the latest sources of jester, I use nimble
The text was updated successfully, but these errors were encountered: