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

Option "Prefix" breaks index.html page, because rootPath is not being set #1818

Open
H3rby7 opened this issue Oct 28, 2019 · 0 comments

Comments

@H3rby7
Copy link

@H3rby7 H3rby7 commented Oct 28, 2019

Bug - "rootPath" not found

If I make use of the app.Option "Prefix", the app immediately fails, because the context does no longer have the function "rootPath()" available.

Steps to Reproduce the Problem

  1. Generate a new Buffalo App
  2. In actions/app.go add Prefix: "/mypath" or even "/mypath/"
  3. Run buffalo dev
  4. Go to localhost:3000/mypath
  5. See the app fail

Expected Behavior

I want my app to run using a different base path

Actual Behavior

The html index page gives a 500 with unknown identifier "rootPath"

Info

Please run buffalo info and paste the information below where it says "PASTE_HERE".

buffalo info
-> Go: Checking installation
✓ The `go` executable was found on your system at: C:\Go\bin\go.exe

-> Go: Checking minimum version requirements
✓ Your version of Go, 1.13.1, meets the minimum requirements.

-> Go: Checking GOPATH
✓ You appear to be operating inside of your GOPATH.

-> Go: Checking Package Management
⚠ You do not appear to be using a package management system.

It is strongly suggested that you use one of the following package management systems:

* Go Modules (Recommended) - https://gobuffalo.io/en/docs/gomods
* Dep - https://github.com/golang/dep

For help setting up your Go environment please follow the instructions for you platform at:

https://www.gopherguides.com/courses/preparing-your-environment-for-go-development

-> Go: Checking PATH
✘ Your PATH (PATH NOT FOUND) does not contain C:\Users\XXXX\go/bin.
**** (I have the go bin in my path, using windows, also I can run go executables like 'soda')

Without C:\Users\XXXX\go/bin in your `PATH` any Go executables can not be run globally.

For help setting up your Go environment please follow the instructions for you platform at:

https://www.gopherguides.com/courses/preparing-your-environment-for-go-development

-> Node: Checking installation
✓ The `node` executable was found on your system at: C:\Program Files\nodejs\node.exe

-> Node: Checking minimum version requirements
✓ Your version of Node, v12.9.1, meets the minimum requirements.

-> NPM: Checking installation
✓ The `npm` executable was found on your system at: C:\Program Files\nodejs\npm.cmd

-> NPM: Checking minimum version requirements
✓ Your version of NPM, 6.9.0, meets the minimum requirements.

-> Yarn: Checking installation
✓ The `yarnpkg` executable was found on your system at: C:\Users\XXXX\AppData\Roaming\npm\yarnpkg.cmd

-> Yarn: Checking minimum version requirements
✓ Your version of Yarn, 1.19.1, meets the minimum requirements.

-> PostgreSQL: Checking installation
✘ The `postgres` executable could not be found on your system.
For help setting up your Postgres environment please follow the instructions for you platform at:

https://www.postgresql.org/download/

-> MySQL: Checking installation
✘ The `mysql` executable could not be found on your system.
For help setting up your MySQL environment please follow the instructions for you platform at:

https://www.mysql.com/downloads/

-> SQLite3: Checking installation
✘ The `sqlite3` executable could not be found on your system.
For help setting up your SQLite3 environment please follow the instructions for you platform at:

https://www.sqlite.org/download.html

-> Cockroach: Checking installation
✘ The `cockroach` executable could not be found on your system.
For help setting up your Cockroach environment please follow the instructions for you platform at:

https://www.cockroachlabs.com/docs/stable/

-> Buffalo (CLI): Checking installation
✓ The `buffalo` executable was found on your system at: C:\Users\XXXX\go\bin\buffalo.exe

-> Buffalo (CLI): Checking minimum version requirements
✓ Your version of Buffalo (CLI), v0.14.10, meets the minimum requirements.

-> Buffalo: Application Details
Pwd         C:\Users\XXXX\go\src\mydomain.com\reman
Root        C:\Users\XXXX\go\src\mydomain.com\reman
GoPath      C:\Users\XXXX\go
PackagePkg  mydomain.com/reman
ActionsPkg  mydomain.com/reman/actions
ModelsPkg   mydomain.com/reman/models
GriftsPkg   mydomain.com/reman/grifts
WithModules false
Name        reman
Bin         bin\reman
VCS         git
WithPop     true
WithSQLite  false
WithDep     false
WithWebpack true
WithNodeJs  true
WithYarn    true
WithDocker  true
WithGrifts  true
AsWeb       true
AsAPI       false
InApp       true
PackageJSON {map[build:webpack -p --progress dev:webpack --watch]}

-> Buffalo: config/buffalo-app.toml
name = "reman"
bin = "bin\\reman"
vcs = "git"
with_pop = true
with_sqlite = false
with_dep = false
with_webpack = true
with_nodejs = true
with_yarn = true
with_docker = true
with_grifts = true
as_web = true
as_api = false

-> Buffalo: config/buffalo-plugins.toml
[[plugin]]
  binary = "buffalo-pop"
  go_get = "github.com/gobuffalo/buffalo-pop"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants
You can’t perform that action at this time.