JiuZZZ commited on
Commit
79bdd72
·
verified ·
1 Parent(s): a302ca3

Update hf.js

Browse files
Files changed (1) hide show
  1. hf.js +2 -3
hf.js CHANGED
@@ -8,12 +8,11 @@ app.use(express.urlencoded({ extended: true, limit: '50mb' }));
8
  app.use('hf/v1/chat/completions', createProxyMiddleware({
9
  target: 'http://localhost:3010',
10
  pathRewrite: {
11
- 'hf/v1/chat/completions': 'v1/chat/completions', // 重写路径,将 /hf/v1/v2 替换为 /hf
12
  },
13
- changeOrigin: true,
14
  }));
15
 
16
  const port = process.env.HF_PORT || 7860;
17
  app.listen(port, () => {
18
- console.log(`Server is running at http://localhost:${port}`);
19
  });
 
8
  app.use('hf/v1/chat/completions', createProxyMiddleware({
9
  target: 'http://localhost:3010',
10
  pathRewrite: {
11
+ '^/hf/': '/',
12
  },
 
13
  }));
14
 
15
  const port = process.env.HF_PORT || 7860;
16
  app.listen(port, () => {
17
+ console.log(`HF Proxy server is running at PORT: ${port}`);
18
  });