修改获取总页数

This commit is contained in:
2024-11-28 10:36:12 +08:00
parent 102c430df5
commit b20848d711
3 changed files with 16 additions and 4 deletions

View File

@@ -6,10 +6,12 @@ import tagsRouter from "./router/tags.js";
import infoRouter from "./router/info.js";
import searchRouter from "./router/search.js";
import homeRouter from "./router/home.js";
import http from "http";
const app = express()
//解决跨域
app.use((req, res, next) => {
// 设置是否运行客户端设置 withCredentials
@@ -32,7 +34,7 @@ app.use('/v1/api/info', infoRouter);
app.use('/v1/api/search', searchRouter);
app.use('/v1/api/home', homeRouter);
app.listen(config.port, () => {
http.createServer(app).listen(config.port, "::",() => {
console.log(`
爬虫运行在下面网址:
@@ -42,5 +44,15 @@ app.listen(config.port, () => {
`)
})
// app.listen(config.port, () => {
// console.log(`
// 爬虫运行在下面网址:
// 1⃣ 公网 IPV6: http://[${ipv6()}]:${config.port}
// 2⃣ 局域网 IPV4: http://${ipv4()}:${config.port}
// `)
// })
export default app