cta / hf.js
JiuZZZ's picture
Update hf.js
3f95836 verified
raw
history blame
463 Bytes
const express = require('express');
const morgan = require('morgan');
const { createProxyMiddleware } = require('http-proxy-middleware');
const app = express();
app.use(morgan('combined'));
app.use('*', createProxyMiddleware({
target: 'http://localhost:3010',
pathRewrite: {
'^/hf/': '/',
},
changeOrigin: true
}));
const port = process.env.HF_PORT || 7860;
app.listen(port, () => {
console.log(`HF Proxy server is running at PORT: ${port}`);
});