forked from noxious/server
Added client URL to .env.example and cors
This commit is contained in:
parent
929a36554a
commit
3b473e5826
@ -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
|
||||||
|
@ -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 }))
|
||||||
|
Loading…
x
Reference in New Issue
Block a user