Skip to content
This repository was archived by the owner on Mar 13, 2025. It is now read-only.

Commit 3d8a0d7

Browse files
author
dengjun
committed
ci:final deploy
1 parent 79f2926 commit 3d8a0d7

File tree

2 files changed

+13
-6
lines changed

2 files changed

+13
-6
lines changed

server.js

-5
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,8 @@
11
/* global process */
22
require("./src/api/bootstrap");
33
const express = require("express");
4-
const cors = require("cors");
54

65
const app = express();
7-
app.use(cors({
8-
// Allow browsers access pagination data in headers
9-
exposedHeaders: ['X-Page', 'X-Per-Page', 'X-Total', 'X-Total-Pages', 'X-Prev-Page', 'X-Next-Page']
10-
}))
116

127
// Register routes
138
require("./src/api/app-routes")(app);

src/api/app-routes.js

+13-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,19 @@ const authenticator = require("tc-core-library-js").middleware.jwtAuthenticator;
1818
*/
1919
module.exports = (app) => {
2020
app.use(express.json());
21-
app.use(cors());
21+
app.use(
22+
cors({
23+
// Allow browsers access pagination data in headers
24+
exposedHeaders: [
25+
"X-Page",
26+
"X-Per-Page",
27+
"X-Total",
28+
"X-Total-Pages",
29+
"X-Prev-Page",
30+
"X-Next-Page",
31+
],
32+
})
33+
);
2234
app.use(
2335
fileUpload({
2436
limits: {

0 commit comments

Comments
 (0)