mirror of
https://github.com/ragestudio/comty.git
synced 2025-06-10 11:04:15 +00:00
added cors to server
This commit is contained in:
parent
c3ec2845f1
commit
394e327430
@ -86,6 +86,7 @@
|
||||
"cross-env": "^7.0.3",
|
||||
"express": "^4.17.1",
|
||||
"typescript": "^4.3.5",
|
||||
"cors": "2.8.5",
|
||||
"vite": "2.9.9"
|
||||
}
|
||||
}
|
@ -1,10 +1,14 @@
|
||||
const express = require("express")
|
||||
const path = require("path")
|
||||
const cors = require("cors")
|
||||
|
||||
const app = express()
|
||||
|
||||
const portFromArgs = process.argv[2]
|
||||
let portListen = portFromArgs ? portFromArgs : 9000
|
||||
|
||||
app.use(cors())
|
||||
|
||||
app.use(express.static(path.join(__dirname, "dist")))
|
||||
|
||||
app.get("*", function (req, res) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user