I’ve got a pre custom middleware installed and it is getting hit before the endpoint is called. However, I can’t even run simple string functions.
var url = request.URL; var path = url.substr(url.indexOf('/',2) + 1, url.length); log(typeof(path)); log(path.contains('venues'));
The first three lines execute. But the last line fails. I tried startsWith too. What is going on?
tyk-gateway_1 | time="Jan 13 05:05:46" level=error msg="Failed to run JS middleware" api_id=venues123 api_name="Tyk Test Keyless API" error="TypeError: 'contains' is not a function" mw=DynamicMiddleware org_id=default123 origin=172.20.0.1 path="/serviceB/venues/15"
Also, if I wanted to use a library like moment or underscore how do I add them?