const express = require('express'); const morgan = require('morgan'); const { createProxyMiddleware } = require('http-proxy-middleware'); const app = express(); app.use(morgan('dev')); app.use('/hf/v1/chat/completions', createProxyMiddleware({ target: 'http://localhost:3010/v1/chat/completions', changeOrigin: true })); app.get('/', (req, res) => { const htmlContent = ` My Static Page

Cursor To OpenAI Server
聊天来源: 自定义(兼容 OpenAI)
自定义端点(基本URL):
自定义API密钥:[抓取的Cursor Cookie,格式为user_...]

`; res.send(htmlContent); }); const port = process.env.HF_PORT || 7860; app.listen(port, () => { console.log(`HF Proxy server is running at PORT: ${port}`); });