mirror of
https://codeberg.org/SafeTwitch/safetwitch-backend.git
synced 2025-03-11 13:41:20 -05:00
Setup cors
This commit is contained in:
parent
7bf75fa99e
commit
a7955614ff
1 changed files with 7 additions and 0 deletions
7
index.ts
7
index.ts
|
@ -11,6 +11,13 @@ dotenv.config()
|
|||
const app: Express = express();
|
||||
const port = process.env.PORT
|
||||
|
||||
app.all('/', function(req, res, next) {
|
||||
res.header("Access-Control-Allow-Origin", "*");
|
||||
res.header("Access-Control-Allow-Headers", "X-Requested-With");
|
||||
next();
|
||||
});
|
||||
|
||||
|
||||
app.use(compression({}))
|
||||
app.use(routes)
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue