UNPKG

450 BJavaScriptView Raw
1'use strict';
2
3var proxy = require('http-proxy-middleware');
4
5module.exports = function (app) {
6
7 app.use(proxy('/api/', {
8 target: 'http://localhost:4000/',
9 ws: true,
10 pathRewrite: {
11 "^/api/": "/"
12 }
13 }));
14
15 app.use(proxy('/images/', {
16 target: 'http://localhost:4000/',
17 pathRewrite: {
18 "^/images/resized/([^/]+)/uploads/(.+)": "/images/$1/$2",
19 "^/images/([^/]+)/uploads/(.+)": "/images/$1/$2"
20 }
21 }));
22};
\No newline at end of file