fix: remove cors

This commit is contained in:
wancat committed 2023-08-21 20:27:44 +08:00
1 parent 5d9951a3a2
commit 4efce2c6b8
4 files changed
+2 -13

No files matched your search

-1
View File
@@ -11,7 +11,6 @@
},
"dependencies": {
"commander": "^11.0.0",
"cors": "^2.8.5",
"dockerode": "^3.3.5",
"express": "^4.18.2",
"jsonwebtoken": "^9.0.1",
+1 -5
View File
@@ -4,11 +4,7 @@ import Session from '../models/session.js'
import { defaultUser, genSessionJWT } from '../utils/auth.js'
export default (server) => {
const io = new Server(server, {
cors: {
origin: '*',
},
})
const io = new Server(server)
io.use(async (socket, next) => {
console.log('Authenticating...')
-6
View File
@@ -3,7 +3,6 @@ import express from 'express'
import http from 'http'
import YAML from 'yaml'
import swaggerUI from 'swagger-ui-express'
import cors from 'cors'
import socketServer from './api/socket.js'
import connectDB from './db.js'
@@ -23,11 +22,6 @@ async function main() {
const swaggerDocument = YAML.parse(file)
app.use('/api-docs', swaggerUI.serve, swaggerUI.setup(swaggerDocument))
app.use(express.json())
app.use(
cors({
origin: '*',
})
)
app.get('/', (req, res) => {
res.send('Hello World!')