mirror of
https://github.com/Floriansylvain/RenewCMS.git
synced 2026-08-19 11:43:22 +02:00
Fixed port .env usages
This commit is contained in:
+1
-3
@@ -13,7 +13,6 @@ import (
|
||||
var (
|
||||
ginMode string
|
||||
apiPort string
|
||||
frontPort string
|
||||
hostAddress string
|
||||
)
|
||||
|
||||
@@ -24,7 +23,6 @@ func initEnvVariables() {
|
||||
|
||||
ginMode = os.Getenv("APP_GIN_MODE")
|
||||
apiPort = os.Getenv("APP_API_PORT")
|
||||
frontPort = os.Getenv("APP_FRONT_PORT")
|
||||
hostAddress = os.Getenv("APP_HOST_ADDRESS")
|
||||
}
|
||||
|
||||
@@ -42,7 +40,7 @@ func initBasicRoutes(r *gin.Engine) {
|
||||
}
|
||||
|
||||
func corsMiddleware(c *gin.Context) {
|
||||
c.Writer.Header().Set("Access-Control-Allow-Origin", fmt.Sprintf("http://%v:%v", hostAddress, frontPort))
|
||||
c.Writer.Header().Set("Access-Control-Allow-Origin", fmt.Sprintf("http://%v", hostAddress))
|
||||
c.Writer.Header().Set("Access-Control-Allow-Credentials", "true")
|
||||
c.Writer.Header().Set("Access-Control-Allow-Headers", "Content-Type, Content-Length, Accept-Encoding, X-CSRF-Token, Authorization, accept, origin, Cache-Control, X-Requested-With")
|
||||
c.Writer.Header().Set("Access-Control-Allow-Methods", "POST, OPTIONS, GET, PUT")
|
||||
|
||||
@@ -1 +1 @@
|
||||
export const baseApiUrl = `http://${__APP_ENV__.APP_HOST_ADDRESS}:${__APP_ENV__.APP_API_PORT}`
|
||||
export const baseApiUrl = `http://${__APP_ENV__.APP_HOST_ADDRESS}`
|
||||
Reference in New Issue
Block a user