0

I am a beginner to node js

I am using an azure website

app.use('/', express.static(__dirname + '/www'));

server.listen(process.env.PORT || 3000);

This creates a webapplication in my localhost When i navigate to http://localhost:3000 I can see the html pages with all the styling

Now the problem is, How can I map it to IIS application?

Because when i create an application in IIS in azure machine, i can access it from outsite by navigating to http://machinename.cloudapp.net/AppName which i will not be able to do if its hosted in Localhost

1 Answer 1

1

This is an awesome scenario, @vignesh. Azure runs node apps great and it's very easy to push and maintain them once you get the hang of it.

You said that when you create an app in IIS, you access it from http://machinename.cloudapp.net/appname. That's if you publish it as a webrole. You could do that, but it's much easier to just use Azure Web Apps. In that case, the address would be http://appname.azurewebsites.net.

You don't have to worry about localhost when you have published to Azure. It's running in an Azure Web App and available to the public at that endpoint. So what you need to do is publish your app to Azure. The coolest way is with the Azure CLI and Git. Look at Install and Configure the Azure CLI to figure out the former and Azure CLI Day 7 – site create with git for the latter.

It's a little easier though if you're not familiar with the command line to create the web app in the Azure portal and then configure it for Git deployment. In that case follow Continuous deployment using GIT in Azure App Service

If you want some more help with this, find me at codefoster.com and ask. I get really excited about Node apps in Azure.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

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

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.