var express = require('express');
var requestProxy = require('express-request-proxy');
var memoryCache = require('memory-cache-stream');
var app = express();
app.get('/data/find', requestProxy({
cache: memoryCache(),
cacheMaxAge: 10,
url: "http://dataservice:5001/getdata/find?query=*"
}));
app.listen(5000, function () {
console.log('Listening: 5000');
});
And the error is:
Error: Expected "0" to be defined
at Function.Error.create (/src/node_modules/express-request-proxy/node_modules/simple-errors/index.js:25:11)
at Function.Error.http (/src/node_modules/express-request-proxy/node_modules/simple-errors/index.js:68:21)
at proxyViaCache (/src/node_modules/express-request-proxy/lib/proxy.js:119:25)
at /src/node_modules/express-request-proxy/lib/proxy.js:58:14
at Layer.handle [as handle_request] (/src/node_modules/express/lib/router/layer.js:95:5)
at next (/src/node_modules/express/lib/router/route.js:131:13)
at Route.dispatch (/src/node_modules/express/lib/router/route.js:112:3)
at Layer.handle [as handle_request] (/src/node_modules/express/lib/router/layer.js:95:5)
at /src/node_modules/express/lib/router/index.js:277:22
at Function.process_params (/src/node_modules/express/lib/router/index.js:330:12)
Hi,
I am getting an error for the following code:
And the error is:
Deps from my package.json
Any idea what I am missing?