Tuesday 6 June 2017

Is it good to place a react-based client package inside a server package folder?

I created an express-based backend (in folder A) and a related react-based front-end project(in folder B) respectively. Now I put B inside A for the following benefits:

1.I don't need to copy files from font-end build to server project anymore because A/server.js can serve files from A/B/build directly.

2.No need to worry about the cross origin request errors.

3.They looks like one project and easier to manage like in github.

But can I run "npm buildjs" from folder A, which actually runs "npm build" in folder B? I guess it has much to do with the npm run-script usage.



via Shawn Chen

No comments:

Post a Comment