From b46d6453d4e327b13c4a6fcb865c34c38d87c3b5 Mon Sep 17 00:00:00 2001 From: qq_41923622 Date: Mon, 10 Feb 2025 13:44:00 +0800 Subject: [PATCH] Mon Feb 10 13:44:00 CST 2025 inscode --- index.js | 24 ------------------------ 1 file changed, 24 deletions(-) diff --git a/index.js b/index.js index 21997f6..e69de29 100644 --- a/index.js +++ b/index.js @@ -1,24 +0,0 @@ -const express = require('express'); -const { createProxyMiddleware } = require('http-proxy-middleware'); - -const app = express(); -const port = 3001; - -// 目标服务器地址 -const targetUrl = 'http://s.hunlihu.com'; - -// 创建代理中间件 -const apiProxy = createProxyMiddleware('/', { - target: targetUrl, - changeOrigin: true, - pathRewrite: { - '^/': '' // 重写请求路径 - } -}); - -// 使用代理中间件 -app.use(apiProxy); - -app.listen(port, () => { - console.log(`Server is running on port ${port}`); -}); \ No newline at end of file -- GitLab