Spaces:
Paused
Paused
| const express = require('express'); | |
| const { createProxyMiddleware } = require('http-proxy-middleware'); | |
| const app = express(); | |
| app.use(express.json({ limit: '50mb' })); | |
| app.use(express.urlencoded({ extended: true, limit: '50mb' })); | |
| app.use('hf/v1/chat/completions', createProxyMiddleware({ | |
| target: 'http://localhost:3010', | |
| pathRewrite: { | |
| '^/hf/': '/', | |
| }, | |
| })); | |
| const port = process.env.HF_PORT || 7860; | |
| app.listen(port, () => { | |
| console.log(`HF Proxy server is running at PORT: ${port}`); | |
| }); |