Comments (2)
Also
package main
import (
"os"
"github.com/gin-gonic/contrib/static"
"github.com/gin-gonic/gin"
)
func main() {
r := gin.Default()
r.Use(static.Serve("/", static.LocalFile(os.Getenv("HOME"), true)))
r.GET("/ping", func(c *gin.Context) {
c.String(200, "test")
})
r.Run(":8080")
}
Return 404 page not found
. But it works in Linux.
from contrib.
I have no Windows machine to try this out; however, by looking at the Go source code, os.Stat()
was patched a few times during 2016/2017 in order to provide better support under Windows and make it 'more compatible' with the routines calling os.Stat()
. As such, this ought to be working fine (in 2023!). Can someone confirm that?
from contrib.
Related Issues (20)
- [WIP] Move all middleware into separate repos on gin-contrib org HOT 8
- Package dependencies HOT 1
- Add the authorization middleware HOT 4
- Fix logrus import in ginrus (due to rename) HOT 3
- session Options is not working HOT 10
- Add the rollbar middleware HOT 2
- Duration for a valid JWT token
- JWT force token expiration HOT 1
- commonlog
- [SOLVED] gin-contrib has gone? HOT 6
- `time` attribute duplicated in logrus/ginrus entry HOT 3
- auto update
- expir
- What is the license? HOT 1
- how to get x-response-time and write it in the http header with gin? HOT 2
- [QUESTION] sessions: Session `Get` method HOT 2
- Broken link in the "About" section HOT 1
- add support for samesite options HOT 1
- Remove repository with stolen source code
- the github page were 404 not found
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from contrib.