forked from UKSOURCE/cms.hailearning.edu.vn
Fix merge conflicts with main
This commit is contained in:
22
server.js
22
server.js
@@ -32,6 +32,28 @@ app.set("layout extractStyles", true);
|
||||
app.use(express.json());
|
||||
app.use(express.urlencoded({ extended: true }));
|
||||
app.use(cookieParser());
|
||||
app.use(
|
||||
"/assets",
|
||||
(req, res, next) => {
|
||||
// Cho phép mọi domain truy cập tài nguyên tĩnh
|
||||
res.header("Access-Control-Allow-Origin", "*");
|
||||
res.header("Access-Control-Allow-Methods", "GET");
|
||||
next();
|
||||
},
|
||||
express.static(path.join(__dirname, "assets")),
|
||||
);
|
||||
app.use(
|
||||
"/uploads",
|
||||
(req, res, next) => {
|
||||
// Cho phép mọi domain truy cập tài nguyên tĩnh
|
||||
res.header("Access-Control-Allow-Origin", "*");
|
||||
res.header("Access-Control-Allow-Methods", "GET");
|
||||
next();
|
||||
},
|
||||
express.static(path.join(__dirname, "public", "uploads")),
|
||||
);
|
||||
|
||||
// Serve other public files
|
||||
app.use(express.static(path.join(__dirname, "public")));
|
||||
|
||||
// Session configuration
|
||||
|
||||
Reference in New Issue
Block a user