You've already forked gun-manager-backend
put code that worked where the code that didn't used to be
This commit is contained in:
3
.gitignore
vendored
3
.gitignore
vendored
@@ -1,4 +1,5 @@
|
||||
.DS_Store
|
||||
.idea/
|
||||
gun_inventory.sqlite
|
||||
*.sqlite
|
||||
gun-manager
|
||||
dist/
|
||||
5
main.go
5
main.go
@@ -22,7 +22,6 @@ func main() {
|
||||
}
|
||||
|
||||
_, err := sql.NewDb(dbFile)
|
||||
|
||||
if err != nil {
|
||||
log.Fatal(err)
|
||||
}
|
||||
@@ -31,10 +30,12 @@ func main() {
|
||||
e.Use(middleware.Logger())
|
||||
e.Use(middleware.Recover())
|
||||
e.Use(middleware.CORSWithConfig(middleware.CORSConfig{
|
||||
AllowOrigins: []string{"http://localhost", "http://127.0.0.1:4173"},
|
||||
AllowOrigins: []string{"http://localhost", "http://127.0.0.1:4173", "http://127.0.0.1:8000"},
|
||||
AllowMethods: nil,
|
||||
}))
|
||||
|
||||
e.Static("/", "dist")
|
||||
|
||||
e.GET("/gun", Guns.Get)
|
||||
e.PUT("/gun/:id", Guns.UpdateGun)
|
||||
e.GET("/gun/:id", Guns.GetById)
|
||||
|
||||
Reference in New Issue
Block a user