use vars to specify cors domain
Signed-off-by: Arthur Lu <learthurgo@gmail.com>
This commit is contained in:
parent
ac08243622
commit
976995e2a1
4
main.js
4
main.js
@ -7,14 +7,14 @@ const morgan = require("morgan");
|
|||||||
const axios = require('axios');
|
const axios = require('axios');
|
||||||
var api = require("./package.json");
|
var api = require("./package.json");
|
||||||
|
|
||||||
const {pveAPI, pveAPIToken, listenPort} = require("./vars.js");
|
const {pveAPI, pveAPIToken, listenPort, domain} = require("./vars.js");
|
||||||
const {init, requestResources, releaseResources} = require("./db.js");
|
const {init, requestResources, releaseResources} = require("./db.js");
|
||||||
|
|
||||||
const app = express();
|
const app = express();
|
||||||
app.use(helmet());
|
app.use(helmet());
|
||||||
app.use(bodyParser.urlencoded({extended: true}));
|
app.use(bodyParser.urlencoded({extended: true}));
|
||||||
app.use(cookieParser())
|
app.use(cookieParser())
|
||||||
app.use(cors({origin: "https://client.tronnet.net"}));
|
app.use(cors({origin: domain}));
|
||||||
app.use(morgan("combined"));
|
app.use(morgan("combined"));
|
||||||
|
|
||||||
|
|
||||||
|
@ -6,5 +6,6 @@ const pveAPIToken = {
|
|||||||
uuid: ""
|
uuid: ""
|
||||||
};
|
};
|
||||||
const listenPort = 80;
|
const listenPort = 80;
|
||||||
|
const domain = "";
|
||||||
|
|
||||||
module.exports = {pveAPI, listenPort, pveAPIToken};
|
module.exports = {pveAPI, listenPort, pveAPIToken, domain};
|
Loading…
Reference in New Issue
Block a user