Mukil Deepthi
Mukil Deepthi

Reputation: 6452

how to deploy angular 6 app to azure node.js empty webapp

I used to deploy my angular app to azure web app. and want to try with nodejs webapp.

Can anyone help me what are the step to do this? Is this same as the other webapp where i copy the files from dist folder and place it in the d:\home\wwwroot\sites\

Right now when i dump the contents into the \site folder of nodejs webapp. i just getting 'Hello world' message. here is the server.js in this location:

var http = require('http');

http.createServer(function (req, res) {

    res.writeHead(200, { 'Content-Type': 'text/html' });
    res.end('Hello, world!');

}).listen(process.env.PORT || 8080);

Thanks

Upvotes: 1

Views: 178

Answers (1)

Bv Kay
Bv Kay

Reputation: 111

You would want to first build your angular app. Check the build command in your package.json but it is normally npm run build.

Then place the contents of the dist folder (or whatever the name of the output folder is) inside the public folder of your nodejs app. Such that the path of the index.html ends up becoming /public/index.html.

Now run your node server, and you should be able to see the page at localhost:your-port/

Upvotes: 1

Related Questions