mirror of
https://github.com/pawelmalak/flame.git
synced 2024-12-25 03:03:03 +03:00
20 lines
472 B
JavaScript
20 lines
472 B
JavaScript
const { createProxyMiddleware } = require('http-proxy-middleware');
|
|
|
|
module.exports = function (app) {
|
|
const apiProxy = createProxyMiddleware('/api', {
|
|
target: 'http://localhost:5005'
|
|
})
|
|
|
|
const assetsProxy = createProxyMiddleware('/uploads', {
|
|
target: 'http://localhost:5005'
|
|
})
|
|
|
|
const wsProxy = createProxyMiddleware('/socket', {
|
|
target: 'http://localhost:5005',
|
|
ws: true
|
|
})
|
|
|
|
app.use(apiProxy);
|
|
app.use(assetsProxy);
|
|
app.use(wsProxy);
|
|
}; |