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
Add a default document names for the static method #3
Comments
Hi @hyingreborn , 'index.html' files are added to the root path by default, I'm planning to disable this as an option in By looking at your example you seem to use the function the wrong way and reversed the parameters, it should be Change your code like this app.Static("/static", "./public/static") |
@Fenny tks for your reply! |
Hi @hyingreborn , The only difference with the static method from fiber is that the The following examples achieve the same results: app := fiber.New()
app.Static("/", "./my/static/files")
// => http://localhost:8080/gopher.png
app.Static("./my/static/files")
// => http://localhost:8080/gopher.png |
Hi @Fenny ,
I hope that through http://127.0.0.1:8080/app to access the directory/public/app, so I this configuration: app := fiber.New()
app.Static("/app", "./public/app") The result is that i can only access index.html as the default document, and no other static files are not accessible,my vue's spa already config public path to "./",It works in subdirectories under both gin and echo。 The expectation should be to map app/* to./public/app/*
By the way, /app doesn't automatically add the "/" suffix |
Add a default document names for the static method plz : "index.html"、"index.htm"、"default.html"、"default.htm"
server.go
when i visit http://127.0.0.1:8080/static,Instead of 404, the contents of index.html are displayed by default
The text was updated successfully, but these errors were encountered: