How to deploy Angular Nest api to VM?

26 views
Skip to first unread message

Shunmugarajan R

unread,
Oct 3, 2019, 3:54:34 AM10/3/19
to Angular and AngularJS discussion

I took the angular api build.I get 2 file(main.js and main.js.map) inside of dist/app folder. I didn't get any index file.So I don't know how to deploy the server. Please help me.

Note: I am using Angular NX.

Sander Elias

unread,
Oct 3, 2019, 4:39:07 AM10/3/19
to Angular and AngularJS discussion
Hi Shunmugarajan,

The index.html should be in your dist folder. Perhaps force a full rebuild.

Regards
Sander

Shunmugarajan R

unread,
Oct 3, 2019, 5:32:19 AM10/3/19
to Angular and AngularJS discussion
Thank you for your reply sir. I don't have any index.html file sir. Because I am using Nx and Angular CLI(https://nx.dev/angular). Multiple application developed here. If once build application, i got index.html except api.

While build api (ng serve api --prod) I got 2 files only (main.js and main.js.map).

I have 3 application in NX angular structure.

1. Student
2. Teacher
3. Api - ( This for mock api )

I have successfully deployed 1 and 2 in production. But I couldn't deploy API. I want to deploy api (mock api) for mobile development service.

Sander Elias

unread,
Oct 4, 2019, 1:32:49 AM10/4/19
to Angular and AngularJS discussion
Hi,

Well, your nest server is not a web-app, but a server app. So it doesn't have an index.html. It needs to be hosted in a different way. How? that highly depends on your setup and on your stack.
If it is just a few functions, you can use firebase function, amazon lambda, or azure functions. (there are more)
When it's more of an app, and needs some more, you might want to look up nodejs hosting.

Regards
Sander

Reply all
Reply to author
Forward
0 new messages