install cors

install cors
This commit is contained in:
aurik3
2022-12-23 10:06:25 -05:00
parent b5323ed423
commit 2e013f53c5
3 changed files with 39 additions and 1 deletions

4
api.js
View File

@@ -4,6 +4,8 @@ const fs = require("fs");
const axios = require("axios");
const shelljs = require("shelljs");
const qrcode = require('qrcode-terminal');
const cors= require('cors');
const config = require("./config.json");
const { Client, LocalAuth } = require("whatsapp-web.js");
@@ -21,7 +23,7 @@ const app = express();
const port = process.env.PORT || config.port;
//Set Request Size Limit 50 MB
app.use(bodyParser.json({ limit: "50mb" }));
app.use(cors());
app.use(express.json());
app.use(bodyParser.urlencoded({ extended: true }));