Comments (3)
A workaround for this issue is to keep your implementation separate and just create a symlink for each plugin in the pdk plugins directory:
/usr/local/kong/plugins/impl/
- /myplugin1
- node_modules/
- package.json
- plugin.js
- /myplugin2
- node_modules/
- package.json
- plugin.js
- ...
/usr/local/kong/plugins/link/
- myplugin1.js -> ../impl/myplugin1/plugin.js
- myplugin2.js -> ../impl/myplugin2/plugin.js
- ...
From /usr/local/kong/plugins/link/
create the symlinks:
ln -s ../impl/myplugin1/plugin.js myplugin1.js
ln -s ../impl/myplugin2/plugin.js myplugin2.js
...
You can script all this with something like the following:
for d in /usr/local/kong/plugins/impl/*/; do \
cd $d && test -r package.json && npm install --ci && \
cd /usr/local/kong/plugins/link/ && ln -s ../impl/$(basename $d)/plugin.js $(basename $d).js; \
done
Then modify the plugins-directory:
pluginserver_js_start_cmd = /usr/local/kong/plugins/node_modules/kong-pdk/bin/kong-js-pluginserver -v --plugins-directory /usr/local/kong/plugins/link/
pluginserver_js_query_cmd = /usr/local/kong/plugins/node_modules/kong-pdk/bin/kong-js-pluginserver --plugins-directory /usr/local/kong/plugins/link/ --dump-all-plugins
from kong-js-pdk.
@douggsky thanks for the response. In the end we decided to migrate all our plugins to Golang, as it seems to be better maintained and it's faster anyway. I think you should add this workaround to the docs, and close this ticket :)
from kong-js-pdk.
Tracking a documentation update in internal ticket KAG-2604, closing this issue.
from kong-js-pdk.
Related Issues (20)
- Issues running tests HOT 4
- Critical severity alert on msgpack dependency HOT 2
- How to add X-Kong-Upstream-Status header to response HOT 4
- Share Data between Plugins in Kong JS PDK HOT 2
- How to set no_consumer flag with kong-js-pdk Schema HOT 4
- Reference to a incorrect module functions HOT 3
- Kong unable to load js plugin HOT 10
- Simplify Module Loading HOT 7
- Plugin Test Case - Cannot use import statement outside a module error HOT 2
- How to convert the response obtained from getRawBody() to a readable format ? HOT 2
- package.json no longer includes files for plugin_test.js HOT 1
- Incorrect assignment of mocked log functions in plugin_test.js
- Problem reading gzipped kong.service.response.get_raw_body() HOT 11
- Modifying response body (no body_filter phase?) HOT 3
- Question: How to wrote Unit tests using plugin_test.js HOT 1
- Question: How to see plugin error inside docker container logs HOT 2
- Missing plugin socket HOT 2
- Accessing Binary Files in plugin HOT 3
- cannot serialize object to string
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from kong-js-pdk.