gobuffalo / buffalo

Rapid Web Development w/ Go
http://gobuffalo.io
MIT License
8.08k stars 579 forks source link

fix URL Prefix #2366

Closed qdongxu closed 1 year ago

qdongxu commented 1 year ago

This PR addresses Issue #2356.

What is being done in this PR?

Type in here a description of the changes in this PR. The web console cannot be opened after setting a URL prefix in actions/app.go :


appOnce.Do(func() {
app = buffalo.New(buffalo.Options{
Env:         ENV,
SessionName: "_prefix_test_session",
Prefix:      "/prefix/",
})
The error is : 

home/index.plush.html: line 5: "rootPath": unknown identifier



### What are the main choices made to get to this solution?
> Type in here a description of the choices made to get to this solution.

`routenamer.go` consider's "/" 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:
1. Add a prefix as above then open `http://127.0.0.1:3000/prefix/` in the browser.
qdongxu commented 1 year ago

closed as submitted to the wrong branch.