Multiple Express Server Scaffold
I recently needed to create a demo of an OAuth2 workflow. This required four servers in total, most with ssl, all running concurrently. The trick was to actually develop this system within my workflow.
By bringing together the various plugins and writing a configurable base express app, I was able to make a scaffold capable of supporting multiple servers, creating ssl certificates on the fly, and loading middleware, routers, and routes dynamically.
- Copy the
/apptemplate and paste it to a sibling folder
- Change the
config.jsonentry to match your new folder
- Make any changes needed to the config
If you need to run more than one server at a time, follow the first 2 steps of the previous list,
then copy the basic config and change the app name and port of the new config, then run
If you have ideas for improving this scaffold or find it useful, please let me know.