I created two applications in my repo using nx: myapp-nodejs, myapp-angular. (not nest)
Now, I want to deploy those apps to my server. (I don't want to use nginx to create a route for api and route for static files - let's say I don't want to use nginx anyway).
myapp-nodejs application runs express and serve the index file.
app.get('*', (req, res) => {
res.sendFile(path.resolve(__dirname, './public/index.html'));
});
So now I need to build those apps, and then copy myapp-angular dist to myapp-nodejs dist\public folder (for the sendFile).
When I try to run the nodejs application in my server it's say I need some packages that in my package.json in my root package.
The problem is I'll install unnecessary packages like angular and more that my server don't need them and not belong to nodejs runtime.
So I though if there is a way to know "this are the packages for nodejs"? in json format maybe? so I do script that detect dependencies against the root package.json and extract the necessary?