File size: 463 Bytes
a302ca3 693011a a302ca3 b42a028 1dfe3c7 a302ca3 79bdd72 a302ca3 98ae1c3 a302ca3 79bdd72 a302ca3 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 |
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}`);
}); |