Feature: programmatic startup/shutdown improvements
See original GitHub issueWhile writing integration tests for plugin I wish I had 3 main features in the gateway:
- A way to shutdown a gateway instance (mainly for testing purposes, when you want to cleanup the resources).
gatewayInstance.close().then(()=>console.log("It's over"));
- A way to know that the gateway is ready to get requests; the
run
method might return a Promise
gatewayInstance.run().then(()=>console.log("Time to proxy requests"));
- A way to feed the gateway configuration from the code directly, and not being constrained to give file paths or directories.
const systemConfig = {};
const gatewayConfig = {}
gateway().load(systemConfig, gatewayConfig).run().then(...)
Issue Analytics
- State:
- Created 6 years ago
- Comments:15 (12 by maintainers)
Top Results From Across the Web
Technical debt · GitHub
Feature : programmatic startup/shutdown improvements #422 opened by XVincentX enhancement. @XVincentX. From The eternal backlog. Copy card link.
Read more >Running shutdown scripts | Compute Engine Documentation
Create and run shutdown scripts that execute commands right before a virtual machine (VM) instance is stopped or restarted. This is useful if...
Read more >Towards accurate modeling of dynamic startup/shutdown and ...
To this end, this paper accurately accesses detailed startup and shutdown procedures of thermal units by simulating dynamic unit temperature evolution and ...
Read more >Discusses Feb 1993 voluntary shutdown in response to indications ...
The New York Power Authority voluntarily shut down the Indian Point 3 Nuclear Power Plant in February 1993 in response to indications of...
Read more >Server Startup and Shutdown Sequences - Communities
Welcome to the new and improved SE Communty! The UI/UX has been upgraded to provide a more intuitive and smoother user experience; This...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@jbalsip quick comment on logs https://github.com/ExpressGateway/express-gateway/blob/ca7b7aff62e36b00ea0aace5a3216edf5d8522f8/lib/plugins.js#L65
in plugin context a logger is passed. a special one for plugins. It log level is controlled by
process.env.LOG_LEVEL_PLUGINS
https://github.com/ExpressGateway/express-gateway/blob/master/lib/logger.js#L48so logs will not be mixed
LOG_LEVEL_PLUGINS=debug
(internal policies use LOG_LEVEL_POLICY) so you should see mostly logs from your plugin and other custom pluginsor use some lib like
debug
to completely separate output+1 to see the tests from your PoC
Our current helpers cover scenarios of running EG in the same process and as a separate process (looks ugly but seems to work) We use separate process to run E2E tests, but those helpers were never utilized in external plugin so it is hard to tell if it actually works correctly
Feel free to make small PRs with helpers as you see it. At some point the picture of helpers will be more or less complete so we document the approach as beta feature on the EG.io site and in the release notes. I believe feedback from others will follow, so the helpers can be improved and moved out of beta status.
beta is mostly to avoid migration issues. One can always reference specific version of EG in their plugin and do migration in there own pace.
Thanks!
That is very helpful @DrMegavolt and thank you. I’ll be sure to incorporate that into what I’m working on.