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

Static files don't work with dynamic routes #257

Open
zolomatok opened this issue Aug 7, 2020 · 2 comments
Open

Static files don't work with dynamic routes #257

zolomatok opened this issue Aug 7, 2020 · 2 comments

Comments

@zolomatok
Copy link

zolomatok commented Aug 7, 2020

Having a file like ./public/yolo.txt and given a simple program...

import jester, htmlgen

routes:
    get "/":
        resp h1("Hello")
    get "/@name":
        resp "Your name is " & @"name"

... will result in yolo.txt not being served ever, because /@name will intercept a call like localhost:5000/yolo.txt. The file is served if I remove the /@name path.

Shouldn't static files take precedence?

Jester 0.4.3

@C-NERD
Copy link

C-NERD commented Jan 8, 2021

try using cond at the top of the get code block like so

import jester, htmlgen

routes:
    get "/":
        resp h1("Hello")
    get "/@name":
        cond '.' notin @"name"
        resp "Your name is " & @"name"

@dom96
Copy link
Owner

dom96 commented Jan 8, 2021

hmmm, not really sure that static files should have precedence tbh. Any ideas how it works in Sinatra?

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

No branches or pull requests

3 participants