I am deploying Node.js into Azure APP service while deploying i am getting the error
error in URL
The page cannot be displayed because an internal server error has occurred.
error in Azure Console
\node [master*]> node index.js
Note: Opening a port for access from a browser is not supported in this environment. To run and browse your application, press the 'Run' button in the toolbar.
welcome node server
welcome db.js
events.js:167
throw er; // Unhandled 'error' event
^
Error: listen EADDRINUSE \\.\pipe\0bed3880-e538-4076-b6f3-d48a9f37861c
at Server.setupListenHandle [as _listen2] (net.js:1269:19)
at listenInCluster (net.js:1334:12)
at Server.listen (net.js:1432:5)
at Function.listen (D:\home\site\wwwroot\node\node_modules\express\lib\application.js:618:24)
at Object.<anonymous> (D:\home\site\wwwroot\node\index.js:79:5)
at Module._compile (internal/modules/cjs/loader.js:688:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:699:10)
at Module.load (internal/modules/cjs/loader.js:598:32)
at tryModuleLoad (internal/modules/cjs/loader.js:537:12)
at Function.Module._load (internal/modules/cjs/loader.js:529:3)
Emitted 'error' event at:
at emitErrorNT (net.js:1313:8)
at process._tickCallback (internal/process/next_tick.js:63:19)
at Function.Module.runMain (internal/modules/cjs/loader.js:744:11)
at startup (internal/bootstrap/node.js:285:19)
at bootstrapNodeJSCore (internal/bootstrap/node.js:739:3)
\node [master*]>
Code is working fine in my local system but its not working in Azure ,I don't know the reason why i am getting this error in Azure .
My code :
console.log('welcome node server ');
const mysql = require('mysql');
const express = require('express');
// var router = express.Router();
const app = express();
const bodyParser = require('body-parser');
const path = require('path');
const fs = require('fs');
const multer = require('multer');
app.use(bodyParser.urlencoded({ extended: true }));
app.use(bodyParser.json());
var connection = require('./db.js');
const cors = require('cors');
// app.use(cors())
// app.use(cors({ origin: "http://localhost:4200", credentials: true }));
//PORT ENVIRONMENT VARIABLE
const port = process.env.PORT || 8080;
app.listen(port, () => { console.log(`APP listening on port ${port}!!!`) });
// var port = process.env.PORT || 1337;
// const PORT = 443;
// app.listen(3600, () => { })
//app.listen(process.env.PORT || 443);
// var port = process.env.PORT || 3031,
// app.listen('port', 3031);
Once check my code i tried different port numbers in different forms but still it is not working , So please tell me if anyone know the solution.