Skip to content

BASEPATH cannot be set via config! #10

@svilupp

Description

@svilupp

First of all, thank you for the awesome productivity hack with @genietools.

I just wanted to point out one unexpected behavior around setting a BASEPATH.
(BASEPATH can be used if you want your URLs to be "127.0.0.1:8000/my/base/path/something" instead of "127.0.0.1:8000/something" for your asset paths. Useful when you use nginx proxy)

Expected behavior: As a user, I would like to set BASEPATH either with ENV["BASEPATH"]="/my/base/path" or with `Genie.Configuration.config!(;base_path="/my/base/path")

Current behavior: Only setting via environment variable BASEPATH works (eg, ENV["BASEPATH"] or passing it when starting Julia BASEPATH="/my/base/path/" julia)

Reason: The following [line] reads BASEPATH directly from ENV without considering the config

Side note: If you want to change your BASEPATH, remember that adjust your routes accordingly (eg, route("/my/base/path/routeA") do .... end) or setup your nginx to remove the extra basepath segment from the forwarded requests!

Discovered in GenieFramework/Stipple.jl#199

Happy to open the PR if there is interest (adding the check for Genie.config.base_path)

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions