Skip to content
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

finding /public instead of evaluating the string #26

Closed
kishorevaishnav opened this issue Feb 20, 2019 · 11 comments · Fixed by #27
Closed

finding /public instead of evaluating the string #26

kishorevaishnav opened this issue Feb 20, 2019 · 11 comments · Fixed by #27

Comments

@kishorevaishnav
Copy link

Hi @syumai,

I feel this is a bug. I copied the example/index.ts code and when browse /hello the code tries to find the public/hello instead of evaluating the string "hello". Here is the screenshots
screen shot 2019-02-20 at 12 49 31 am
screen shot 2019-02-20 at 12 49 19 am

even if I try any other URL
http://localhost:8080/error
or
http://localhost:8080/info

it waits but doesn't renders.

@syumai
Copy link
Owner

syumai commented Feb 20, 2019

I'll check this, thanks!

@syumai
Copy link
Owner

syumai commented Feb 20, 2019

@kishorevaishnav
This doesn't seem bug to me.
But launch options are needed.
Please add --allow-net --allow-read to command.
(e.g. deno index.ts --allow-net --allow-read)
I'll fix README.md

@syumai
Copy link
Owner

syumai commented Feb 20, 2019

I added description for this.
5db9c32

@syumai
Copy link
Owner

syumai commented Feb 20, 2019

Sorry, there's problem. I'll fix this 🙏

@kishorevaishnav
Copy link
Author

@syumai I tried both it didn't work. Is there anything I should check. I did Ctrl+C after a minute.
screen shot 2019-02-20 at 1 08 43 am

@kishorevaishnav
Copy link
Author

Sorry, there's problem. I'll fix this 🙏

ok fine.

@syumai
Copy link
Owner

syumai commented Feb 20, 2019

Resolved.
I'll fix other methods (POST, PUT...) later.

@syumai syumai mentioned this issue Feb 20, 2019
@kishorevaishnav
Copy link
Author

It resolved the GET method. Though I have to tell you that, still it tries to access "public/hello", which I feel is not correct.
⚠️ Deno requests read access to "public/hello". Grant? [yN] y

@syumai
Copy link
Owner

syumai commented Feb 20, 2019

@kishorevaishnav
Current dinatra's path resolving order is below.

  1. find static file
  2. if file was not found, then find handler

Now I agree with you that this order is not intuitive.
I'll reverse the order.

@syumai
Copy link
Owner

syumai commented Feb 20, 2019

I opened this as new issue
#28

@kishorevaishnav
Copy link
Author

I tested and it works fine.

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