forked from UKSOURCE/cms.hailearning.edu.vn
feat:Add blog management page and enhance admin layout
This commit is contained in:
17
server.js
17
server.js
@@ -43,6 +43,23 @@ app.use(
|
||||
express.static(path.join(__dirname, "assets")),
|
||||
);
|
||||
|
||||
// Serve static files from public directory (uploads, etc.)
|
||||
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
|
||||
app.use(
|
||||
session({
|
||||
|
||||
Reference in New Issue
Block a user