|
@@ -13,6 +13,7 @@ import cors from "cors";
|
|
|
import epub from "./router/epub/index.js";
|
|
|
|
|
|
import { generateToken, verifyToken } from "#utils";
|
|
|
+import logger from '#logger'
|
|
|
|
|
|
const port = 3000;
|
|
|
const app = express();
|
|
@@ -49,11 +50,12 @@ app.use(async function timeLog(req, res, next) {
|
|
|
if (fileId) {
|
|
|
return res.redirect(`/api/v1/files/${fileId}`);
|
|
|
} else {
|
|
|
- console.error("File ID not found in referer");
|
|
|
+ logger.error("File ID not found in referer");
|
|
|
}
|
|
|
}
|
|
|
next();
|
|
|
});
|
|
|
+logger.error("error error error error error error error ");
|
|
|
|
|
|
// 静态文件目录,添加前缀路径 /static
|
|
|
// app.use("/static", express.static("public"));
|
|
@@ -76,4 +78,5 @@ app.use("/api/v1/epub", epub);
|
|
|
|
|
|
app.listen(port, () => {
|
|
|
console.log(`Example app listening on port ${port}`);
|
|
|
+ logger.info(`Example app listening on port ${port}`)
|
|
|
});
|