1
0
forked from noxious/server
This commit is contained in:
Dennis Postma 2024-11-13 13:35:41 +01:00
parent cf954979c5
commit 719c75616e

View File

@ -27,11 +27,12 @@ export class Server {
*/
constructor() {
this.app = express()
this.app.use(
cors({
origin: config.CLIENT_URL // Allow CORS from the client URL
})
)
this.app.use(cors({
origin: config.CLIENT_URL,
methods: ['GET', 'POST', 'PUT', 'DELETE', 'OPTIONS'], // Add supported methods
allowedHeaders: ['Content-Type', 'Authorization'], // Add allowed headers
credentials: true // Enable if you're using cookies/credentials
}))
this.app.use(express.json())
this.app.use(express.urlencoded({ extended: true }))
this.http = httpServer(this.app)