-
-
Notifications
You must be signed in to change notification settings - Fork 578
Conversation
1d9cb12
to
4a6abba
Compare
8b77efd
to
f86993c
Compare
This PR is not acceptable:
Basically, I agree that the path name should be preserved when we use the prefix to make the app can be ported (mounted) in a different prefix easily without code level change. However, we cannot change this behavior in v1. Also, I have the plan (#2240) to rewrite related things including App, Home, Group, and route information then this behavior could be redefined at that moment. |
Hi @sio4, trimming the prefix from the route name, resolved both concerns. This is a fully backward-compatible solution. |
While the current code generates a route name as |
b348f35
to
98b4330
Compare
…efix present or not.
No. the code has been updated as generating a route name as Input with a prefix: app = buffalo.New(buffalo.Options{
Env: ENV,
SessionName: "_prefix_test_session",
Prefix: "/prefix",
})
app.GET("/", HomeHandler)
app.GET("/about/", About)
app.GET("/prefix/about/", About)
h1 := app.VirtualHost("h1.com")
h1.GET("/func1", VirtualHost1About)
h2 := app.VirtualHost("h2.com")
h2.GET("/func1", VirtualHost2About)
g1 := app.Group("/group/")
g1.GET("func2", About)
subg1 := g1.Group("subg")
subg1.GET("func3", About)
app.Resource("/base-res", &buffalo.BaseResource{}) Route names are identical as no prefix configured:
|
No, what I mean is that the result should be preserved as the same as today (which is Also, your PR is targeted to the I would like to keep this PR as the status of blocked and will revisit it once we started working on the new major version soon. |
Also, in the next major version, the App/Home/Group structure could be completely changed as I already linked the open issue #2240. So I am not fully sure if we can merge this change directly or just need to fix the issue in a different way. |
Currently It will be great if this issue is scheduled in #2240. thanks for your patient clarification, @sio4 |
This PR closed as it will be addressed in #2240 |
This PR addresses Issue #2356.
What is being done in this PR?
The error is :
What are the main choices made to get to this solution?
routenamer.go
considers "/" as the root path only, ignoring a URL prefix as a root path.List the manual test cases you've covered before sending this PR:
http://127.0.0.1:3000/prefix/
in the browser.