Test cors change (#40)
Reviewed-on: #40
This commit was merged in pull request #40.
This commit is contained in:
@@ -11,6 +11,7 @@ import (
|
||||
"os"
|
||||
"strconv"
|
||||
|
||||
"github.com/gin-contrib/cors"
|
||||
"github.com/gin-gonic/gin"
|
||||
)
|
||||
|
||||
@@ -353,6 +354,7 @@ func start(ctx context.Context, config *ServerConfig) {
|
||||
defer db.db.MustClose()
|
||||
|
||||
router := gin.Default()
|
||||
router.Use(cors.Default())
|
||||
router.GET("/api/users", getUsers)
|
||||
router.GET("/api/user/:userId", getUser)
|
||||
router.POST("/api/user/:userId/allowance", postAllowance)
|
||||
@@ -396,6 +398,7 @@ func start(ctx context.Context, config *ServerConfig) {
|
||||
func main() {
|
||||
config := ServerConfig{
|
||||
Datasource: os.Getenv("DB_PATH"),
|
||||
Addr: ":8080",
|
||||
}
|
||||
start(context.Background(), &config)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user