Azure Node JS WebApp

sujith reddy komma 76 Reputation points
2020-01-15T09:23:45.823+00:00

Hi,

I have a simple Node Js Script like below. its just a simple Get Operation.

const express = require('express');

const app = express();

const port = process.env.PORT || 3000;

app.get('/', (req, res) => {
res.send('Welcome to my Nodemon API!');
});

app.listen(port, () => {
console.log(Running on port ${port});
});

I deployed it into a webapp of node 10 Runtime Stack. Now i want to access this get api. i dont have any front end pages. I just need to access my apis.

My Website Url looks like below https://XXX.azurewebsites.net.

How will i access my Get Operation with the above code?

Is it possible webapp only have the apis but not any front end pages?

Azure App Service
Azure App Service
Azure App Service is a service used to create and deploy scalable, mission-critical web apps.
6,956 questions
{count} votes

5 answers

Sort by: Most helpful
  1. Piyush Mutha 11 Reputation points
    2020-01-25T13:41:25.227+00:00

    try using port number after url.
    https://XXX.azurewebsites.net:3000


  2. Tech Gropse 1 Reputation point
    2020-01-27T09:48:45.997+00:00

    Mobile Application Development Companies USA Uses Twelve factor App Methodology to plan and execute the app development process efficiently.

    0 comments No comments

  3. sujith reddy komma 76 Reputation points
    2020-01-27T10:12:30.77+00:00

    I just changed form app.js to index.js now it works


  4. Nigel Wright 291 Reputation points
    2021-06-07T03:41:14.563+00:00

    After res.send you need a res.end(); to end the send or page will keep on trying to load forever.

    0 comments No comments

  5. Vikas agarwal 0 Reputation points
    2024-04-04T07:01:06.39+00:00

    The popularity of NodeJS frameworks is increasing due to the growing demand for web app development to create robust and scalable solutions.

    0 comments No comments