1
0
forked from noxious/server

Added client URL to .env.example and cors

This commit is contained in:
Dennis Postma 2024-11-05 00:27:09 +01:00
parent 929a36554a
commit 3b473e5826
2 changed files with 2 additions and 1 deletions

View File

@ -4,6 +4,7 @@ PORT=4000
DATABASE_URL="mysql://root@localhost:3306/nq" DATABASE_URL="mysql://root@localhost:3306/nq"
REDIS_URL="redis://@127.0.0.1:6379/4" REDIS_URL="redis://@127.0.0.1:6379/4"
JWT_SECRET="secret" JWT_SECRET="secret"
CLIENT_URL="https://localhost:5173"
# Game configuration # Game configuration
ALLOW_DIAGONAL_MOVEMENT=false ALLOW_DIAGONAL_MOVEMENT=false

View File

@ -28,7 +28,7 @@ export class Server {
constructor() { constructor() {
this.app = express() this.app = express()
this.app.use(cors({ this.app.use(cors({
origin: 'https://sylvan.quest' origin: config.CLIENT_URL
})) }))
this.app.use(express.json()) this.app.use(express.json())
this.app.use(express.urlencoded({ extended: true })) this.app.use(express.urlencoded({ extended: true }))