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