Make CORS used outside of development env
This commit is contained in:
parent
9dd320108f
commit
cd9de6d578
@ -25,13 +25,13 @@ func init() {
|
||||
Data: assets.Favicon,
|
||||
}))
|
||||
|
||||
if config.Environment == "development" {
|
||||
app.Use(cors.New(cors.Config{
|
||||
AllowOrigins: "*",
|
||||
AllowMethods: "HEAD,OPTIONS,GET",
|
||||
ExposeHeaders: "X-Cache-Hit,X-Cache-Time-Remaining",
|
||||
}))
|
||||
app.Use(cors.New(cors.Config{
|
||||
AllowOrigins: "*",
|
||||
AllowMethods: "HEAD,OPTIONS,GET,POST",
|
||||
ExposeHeaders: "X-Cache-Hit,X-Cache-Time-Remaining",
|
||||
}))
|
||||
|
||||
if config.Environment == "development" {
|
||||
app.Use(logger.New(logger.Config{
|
||||
Format: "${time} ${ip}:${port} -> ${status}: ${method} ${path} (${latency})\n",
|
||||
TimeFormat: "2006/01/02 15:04:05",
|
||||
|
||||
Loading…
Reference in New Issue
Block a user