Re: Failed to load Middleware JS: open ... no such file or directory

Imported Google Group message. Original thread at: Redirecting to Google Groups Import Date: 2016-01-19 21:44:41 +0000.
Sender:Martin Buhr.
Date:Tuesday, 19 January 2016 17:59:27 UTC.

Hi Angus,

Have you tried an absolute path in the API definition?

Many thanks,
Martin

On Tue, Jan 19, 2016 at 8:23 AM -0800, “Angus Tse” [email protected] wrote:

So appreciate your prompt responses.

I was trying the middleware but failed to load. Any hints ?

INFO[0028] → Loading API: Test Middleware
INFO[0028] ----> Tracking: (no host)
ERRO[0028] Failed to load Middleware JS: open middleware/sample_pre.js: no such file or directory
ERRO[0028] Failed to load Middleware JS: open middleware/sample_post.js: no such file or directory

vagrant@precise64:/opt/tyk-gateway$ ls middleware
sampleMiddleware.js sample_post.js sample_pre.js testPostVirtual.js testVirtual.js

vagrant@precise64:/opt/tyk-gateway$ vim tyk.conf
{
“listen_port”: 8080,
“secret”: “352d20ee67be67f6340b4c0605b044b7”,
“template_path”: “/opt/tyk-gateway/templates”,
“tyk_js_path”: “/opt/tyk-gateway/js/tyk.js”,
“use_db_app_configs”: true,
“app_path”: “/opt/tyk-gateway/apps”,
“middleware_path”: “/opt/tyk-gateway/middleware”,

“enable_jsvm”: true
}

API Definition

{
“name”: “Test Middleware”,

“proxy”: {
“listen_path”: “/middleware/”,
“target_url”: “http://my-awesome-portal.com:30000/model.json”,
“strip_listen_path”: true
},
“custom_middleware”: {
“pre”: [
{
“name”: “samplePreProcessMiddleware”,
“path”: “middleware/sample_pre.js”, // same result if i use sample_pre.js
“require_session”: false
}
],
“post”: [
{
“name”: “samplePostProcessMiddleware”,
“path”: “middleware/sample_post.js”, // same result if i use sample_post.js
“require_session”: false
}
]
}
}


You received this message because you are subscribed to the Google Groups “Tyk Community Support” group.
To unsubscribe from this group and stop receiving emails from it, send an email to [email protected].
To view this discussion on the web, visit https://groups.google.com/d/msgid/tyk-community-support/48079858-3675-4a55-93b1-39eeb44c691c%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.