Allow express app to be (optionally) passed to start-server#284
Allow express app to be (optionally) passed to start-server#284Shelob9 wants to merge 2 commits intoWordPress:trunkfrom
Conversation
|
Hey @Shelob9, thanks for working on this. While this could work there is a much better way to do it with Playground instead of WP-NOW. FYI @juanmaguitar |
Why is this better? The reason I chose to do it this way was:
|
WP-now is a tool that uses Playground and is built for local development. |
|
A middleware could be used in any express server, while hooking into wp-now makes it specific to the way wp-now is booted and configured. |
What?
apparg tostartServerthat is express app.Why?
I wanted to see if I could integrate this with an existing express app. I was able to make it work with one small change that I think is a useful change. Would allow using WordPress for part of a node application and or easily plug this package into existing application
This is what I am thinking:
How?
Testing Instructions
No Changes test
npx nx preview wp-now startWorks this way test
npm link @wp-now/wp-nowhttps://docs.npmjs.com/cli/v9/commands/npm-link