mirror of
https://github.com/Floriansylvain/RenewCMS.git
synced 2026-08-19 11:43:22 +02:00
Fix URLs tentative
This commit is contained in:
@@ -12,7 +12,8 @@ docker-compose up
|
|||||||
TODO
|
TODO
|
||||||
## Environment variables
|
## Environment variables
|
||||||
- ./env
|
- ./env
|
||||||
- APP_HOST_ADDRESS
|
- APP_API_ADDRESS
|
||||||
|
- APP_FRONT_ADDRESS
|
||||||
- APP_API_PORT
|
- APP_API_PORT
|
||||||
- APP_FRONT_PORT
|
- APP_FRONT_PORT
|
||||||
- APP_JWT_SECRET
|
- APP_JWT_SECRET
|
||||||
|
|||||||
+5
-5
@@ -11,9 +11,9 @@ import (
|
|||||||
)
|
)
|
||||||
|
|
||||||
var (
|
var (
|
||||||
ginMode string
|
ginMode string
|
||||||
apiPort string
|
apiPort string
|
||||||
hostAddress string
|
apiAddress string
|
||||||
)
|
)
|
||||||
|
|
||||||
func initEnvVariables() {
|
func initEnvVariables() {
|
||||||
@@ -23,7 +23,7 @@ func initEnvVariables() {
|
|||||||
|
|
||||||
ginMode = os.Getenv("APP_GIN_MODE")
|
ginMode = os.Getenv("APP_GIN_MODE")
|
||||||
apiPort = os.Getenv("APP_API_PORT")
|
apiPort = os.Getenv("APP_API_PORT")
|
||||||
hostAddress = os.Getenv("APP_HOST_ADDRESS")
|
apiAddress = os.Getenv("APP_FRONT_ADDRESS")
|
||||||
}
|
}
|
||||||
|
|
||||||
func initJWT() {
|
func initJWT() {
|
||||||
@@ -40,7 +40,7 @@ func initBasicRoutes(r *gin.Engine) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func corsMiddleware(c *gin.Context) {
|
func corsMiddleware(c *gin.Context) {
|
||||||
c.Writer.Header().Set("Access-Control-Allow-Origin", fmt.Sprintf("http://%v", hostAddress))
|
c.Writer.Header().Set("Access-Control-Allow-Origin", fmt.Sprintf("http://%v", apiAddress))
|
||||||
c.Writer.Header().Set("Access-Control-Allow-Credentials", "true")
|
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-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")
|
c.Writer.Header().Set("Access-Control-Allow-Methods", "POST, OPTIONS, GET, PUT")
|
||||||
|
|||||||
@@ -1 +1 @@
|
|||||||
export const baseApiUrl = `http://${__APP_ENV__.APP_HOST_ADDRESS}`
|
export const baseApiUrl = `http://${__APP_ENV__.APP_API_ADDRESS}`
|
||||||
@@ -1,4 +1,3 @@
|
|||||||
import { useAuthStore } from "@/stores/AuthStore"
|
|
||||||
import { baseApiUrl } from "@/utils/api"
|
import { baseApiUrl } from "@/utils/api"
|
||||||
|
|
||||||
export interface Article {
|
export interface Article {
|
||||||
|
|||||||
Reference in New Issue
Block a user