File tree Expand file tree Collapse file tree 2 files changed +19
-4
lines changed Expand file tree Collapse file tree 2 files changed +19
-4
lines changed Original file line number Diff line number Diff line change @@ -3,6 +3,7 @@ package main
33import (
44 "gin-mongo-api/src/database"
55 "gin-mongo-api/src/routes"
6+ "log"
67 "github.com/gin-contrib/cors"
78 "github.com/gin-contrib/secure"
89 limits "github.com/gin-contrib/size"
@@ -12,15 +13,19 @@ import (
1213func main () {
1314 router := gin .Default ()
1415 config := cors .DefaultConfig ()
15- config .AllowOrigins = []string {"http://google.com" }
16- router .Use (limits .RequestSizeLimiter (10 ))
17- database .ConnectDB ()
16+ config .AllowOrigins = []string {"*" }
17+ router .Use (limits .RequestSizeLimiter (100 ))
18+
19+ database .ConnectDB ();
1820 router .Use (secure .New (secure.Config {
1921 FrameDeny : true ,
2022 ContentTypeNosniff : true ,
2123 BrowserXssFilter : true ,
2224 ContentSecurityPolicy : "default-src 'self'" ,
2325 }))
2426 routes .UserRoute (router )
25- router .Run (":6000" )
27+
28+ if err := router .Run (":6000" ); err != nil {
29+ log .Fatalf ("Failed to start the server: %v" , err )
30+ }
2631}
Original file line number Diff line number Diff line change 1+ {
2+ "trailingSlash" :false ,
3+ "reWrites" :
4+ [
5+ {
6+ "source" :" /(.*)" ,
7+ "destination" :" /main.go"
8+ }
9+ ]
10+ }
You can’t perform that action at this time.
0 commit comments