Jinsu Park

CORS 허용 설정

1 const config = require('./config/config') 1 const config = require('./config/config')
2 2
3 const app = require('express')(); 3 const app = require('express')();
4 +const cors = require('cors')
5 +app.use(cors()) //express 기본 응답에 대한 cors
4 const http = require('http').Server(app); 6 const http = require('http').Server(app);
5 -const io = require('socket.io')(http); 7 +const io = require('socket.io')(http, {
8 + cors:{
9 + origin: "*",
10 + }
11 +});
6 const papago = require('./openAPIs/papago_api'); 12 const papago = require('./openAPIs/papago_api');
7 13
8 const tmi = require('tmi.js'); 14 const tmi = require('tmi.js');
......