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

version 1.11.0 route get/post bug? #760

Open
AdilsonDev opened this issue Jan 10, 2023 · 2 comments
Open

version 1.11.0 route get/post bug? #760

AdilsonDev opened this issue Jan 10, 2023 · 2 comments

Comments

@AdilsonDev
Copy link

Hello @leafo

I have a problem here when moving from version 1.10.0 to 1.11.0 this route is giving a 404 error, this did not happen before in other previous versions.

Whenever I use / before the file name (/api/foo), the error occurs.

Would it be a bug?

app:get('/api/foo', '/api/foo', function(req)
  return { render = true, layout = "api.layout" }
end)
@leafo
Copy link
Owner

leafo commented Jan 10, 2023

I hadn't considered the use-case where a route name looks like a path with a leading /. Is there a reason why you chose this approach?

Route names are intended to be partial module paths (eg. api.foo), since there are many parts of lapis that use the route name to automatically load the corresponding module.

@AdilsonDev
Copy link
Author

AdilsonDev commented Jan 10, 2023

No reason in particular, I just thought the file path would be "views" .. "/api/foo" so I put it with "/" and when updating Lapis it broke some routes on the website, but I already fixed the routes to use without the "/".

Thank you for your reply.

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

2 participants