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

ServeFiles not working within an app from Group #1816

Open
paganotoni opened this issue Oct 26, 2019 · 0 comments
Assignees

Comments

@paganotoni
Copy link
Member

@paganotoni paganotoni commented Oct 26, 2019

Description

When using App#ServeFiles in an App that results from app.Group, the the path is not being added to a.filepath. This causes that doing group.ServeFiles doesn't work because a trailing slash is added to the route.

Steps to Reproduce the Problem

In your app.go create a group and use that group to ServeFiles as the following example:

//in app.go
...

admin := app.Group("/admin")
admin.ServeFiles("assets", AssetsBox)

Then run your app and try to access:

http://localhost:3000/admin/assets/manifest.json

Expected Behavior

Manifest should render (JSON thing generated by webpack).

Actual Behavior

App returns 404.

@paganotoni paganotoni changed the title ServeFiles ServeFiles not working within an app from Group Oct 26, 2019
@paganotoni paganotoni self-assigned this Oct 31, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
1 participant
You can’t perform that action at this time.