Open Shelob9 opened 4 months ago
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. Playground has a CLI server and it would be great if there was an Express middleware that could run Playground CLI requests. Would you be up for working on this in the Playground repository?
FYI @juanmaguitar
While this could work there is a much better way to do it with Playground instead of WP-NOW.
Why is this better? The reason I chose to do it this way was:
/
route is added by wp-nowWhy is this better?
WP-now is a tool that uses Playground and is built for local development. Playground CLI is the standard way of running Playground servers. By contributing to the Playground CLI everyone gets the benefits.
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?
app
arg tostartServer
that 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 start
Works this way test
npm link @wp-now/wp-now
https://docs.npmjs.com/cli/v9/commands/npm-link