1

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

1 Answer 1

1

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/

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.