Files
pte/newBackApi/app.js
2024-11-22 12:31:44 +08:00

27 lines
616 B
JavaScript
Raw Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

import express from "express";
import config from "./config/config.js";
import { ipv6, ipv4 } from "./utils/ip.js";
import tagsRouter from "./router/tags.js";
import infoRouter from "./router/info.js";
import searchRouter from "./router/search.js";
const app = express()
app.use('/api/v1/tag', tagsRouter);
app.use('/api/v1/info', infoRouter);
app.use('/api/v1/search', searchRouter);
app.listen(config.port, () => {
console.log(`
爬虫运行在下面网址:
1⃣ 公网IPV6: http://[${ipv6()}]:${config.port}
2⃣ 局域网IPV4: http://${ipv4()}:${config.port}
`)
})
export default app