简体   繁体   中英

How do I deploy a NodeJS project as an API

I would like to know the appropriate way to deploy a Node server/api on Heroku so that both my Angular web app (also hosted on Heroku) and NativeScript mobile app can use the same API.

Can i deploy the MEAN stack app, meaning, Angular together with the NodeJS server and the NativeScript app will just make request to the server that is deployed with the Angular web app, will i get the expected responses? Is there a better/correct way of doing this, which sources can i look at that would help me out.

Thanks

I think you might want to separate the API from the front-end part of your app, especially since you want to use it from both a web app and a native app.

So you might want to host the API on heroku and then make calls to it from your code.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM