Skip to content

Commit

Permalink
cors added
Browse files Browse the repository at this point in the history
  • Loading branch information
Dustec committed Nov 17, 2021
1 parent 83e7bac commit 1ec77d8
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 0 deletions.
2 changes: 2 additions & 0 deletions models/server.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ const express = require('express');
const http = require('http');
const socketio = require('socket.io');
const path = require('path');
const cors = require('cors');
const Sockets = require('./sockets');

class Server {
Expand All @@ -14,6 +15,7 @@ class Server {

middlewares() {
this.app.use(express.static(path.resolve(__dirname, '../public')));
this.app.use(cors());
}

configSockets(){
Expand Down
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
"author": "",
"license": "ISC",
"dependencies": {
"cors": "^2.8.5",
"dotenv": "^10.0.0",
"express": "^4.17.1",
"socket.io": "^4.3.2"
Expand Down

0 comments on commit 1ec77d8

Please sign in to comment.