proxyips hinzugefügt
This commit is contained in:
3
.env
3
.env
@@ -1,4 +1,5 @@
|
|||||||
DB_HOST=localhost
|
DB_HOST=localhost
|
||||||
DB_USER=besucher
|
DB_USER=besucher
|
||||||
DB_PASS=besucher
|
DB_PASS=besucher
|
||||||
DB_DATA=besucher
|
DB_DATA=besucher
|
||||||
|
PROXYIP=172.19.0.2
|
||||||
6
app.go
6
app.go
@@ -12,13 +12,15 @@ import (
|
|||||||
)
|
)
|
||||||
|
|
||||||
type App struct {
|
type App struct {
|
||||||
r *gin.Engine
|
r *gin.Engine
|
||||||
db *gorm.DB
|
proxyips []string
|
||||||
|
db *gorm.DB
|
||||||
}
|
}
|
||||||
|
|
||||||
func (a *App) start() {
|
func (a *App) start() {
|
||||||
a.db.AutoMigrate(&planner.Besucher{})
|
a.db.AutoMigrate(&planner.Besucher{})
|
||||||
a.r.Use(CORSMiddleware())
|
a.r.Use(CORSMiddleware())
|
||||||
|
a.r.SetTrustedProxies(a.proxyips)
|
||||||
a.r.NoRoute((func(c *gin.Context) {
|
a.r.NoRoute((func(c *gin.Context) {
|
||||||
dir, file := path.Split(c.Request.RequestURI)
|
dir, file := path.Split(c.Request.RequestURI)
|
||||||
ext := filepath.Ext(file)
|
ext := filepath.Ext(file)
|
||||||
|
|||||||
Reference in New Issue
Block a user