-
Notifications
You must be signed in to change notification settings - Fork 0
/
mad-proxy.config.js
45 lines (44 loc) · 2.08 KB
/
mad-proxy.config.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
/* eslint-disable indent */
module.exports = {
server: { //local server configuration block
port: 8088, // [required]
},
proxy: { //reverse proxy configuration block
changeOrigin: true,
secure: true,
disabled: false, //Disable proxy, only locally available files will be served
},
proxies: [ // ... it's kind'of required block
{
path: '/services', // [required] poxed url path to target
target: 'http://google.com', // [required] proxy target
// This mean all request done to http://localhost:8088/services/*
// will be delegated to http://google.com/services/*
cache: { //cache configuration block
enabled: true, //save new cache files & serve them when match request
meta: false, //TODO: store request/response meta (headers, resp code)
//When set to false all cached files will be served with 200 response code with minimum meta data
hashing: true, //TODO: file names will contain crc32 hash based on query & payload request, instead of plain text
madCache: true, //TODO: cache all request's (even 404) will be cached as success (200)
//Requires disabled meta storing
filtering: { //describes what should be cached
//TODO
},
},
},
{
path: '/public',
target: '../assets/public', //target can point to local directory as well
//this will work as simply static server
cache: {
enabled: false, //sorry but caching local files is not supported at the moment
},
},
{
path: '/',
target: '../other_public/index.html', // serving single file ? wny not ?
},
],
mock: './mockDir', //directory for cached files
log: 'DEBUG', // logging level [ALL, DEBUG, INFO, WARN, ERROR, FATAL, OFF]
};