Thank you. I read these articles before and they require a Windows PC.
I have a Macbook running OS X. Is there an alternative?
This browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
I'm trying to deploy multiple Nodejs + Express API's from subfolders/virtual applications under one App Service.
For those that are wondering why: We have one custom domain for a set of API's. There is one common API that all apps will use and separate API's to/from different service providers.
The url's would be something like https://mydomain.com/common, https://mydomain.com/app1, etc.
I've spent the last several days researching this Q&A, MSDN blogs and Stack Overflow and trying multiple solutions with no success.
Here's what I've tried/accomplished:
Detailed Error Information:
Module iisnode
Notification ExecuteRequestHandler
Handler iisnode
Error Code 0x00000000
Requested URL https://cpr-node-test:80/common/index.js
Physical Path C:\home\site\wwwroot\common\index.js
Logon Method Anonymous
Logon User Anonymous
Here is my index.js code:
const express = require('express');
const app = express();
const host = process.env.WEBSITE_HOSTNAME
const port = process.env.PORT || 1337;
app.get('/', (req, res) => res.send(App1 host ${host} listening on port ${port}!
));
app.listen(port, () => console.log(Example app1 host ${host} llistening on port ${port}!
));
Here is my web.config file:
<?xml version="1.0" encoding="utf-8"?>
<!--
This configuration file is required if iisnode is used to run node processes behind
IIS or IIS Express. For more information, visit:
https://github.com/tjanczuk/iisnode/blob/master/src/samples/configuration/web.config
-->
<configuration>
<system.webServer>
<handlers>
<add name="iisnode" path=".js" verb="" modules="iisnode" />
</handlers>
<rewrite>
<rules>
<!-- Don't interfere with requests for node-inspector debugging -->
<rule name="NodeInspector" patternSyntax="ECMAScript" stopProcessing="true">
<match url="^index.js\/debug[\/]?" />
</rule>
<!-- First we consider whether the incoming URL matches a physical file in the /public folder -->
<rule name="StaticContent">
<action type="Rewrite" url="public{REQUEST_URI}"/>
</rule>
<!-- All other URLs are mapped to the Node.js application entry point -->
<rule name="DynamicContent">
<conditions>
<add input="{REQUEST_FILENAME}" matchType="IsFile" negate="True"/>
</conditions>
<action type="Rewrite" url="index.js"/>
</rule>
</rules>
</rewrite>
<iisnode watchedFiles="*.js;node_modules\*;routes\*.js;views\*.jade"/>
<directoryBrowse enabled="true"/>
</system.webServer>
</configuration>
I'd appreciate any help I can get. Thanks
Thank you. I read these articles before and they require a Windows PC.
I have a Macbook running OS X. Is there an alternative?
On a macOS you use launchd to start the node projects with different ports. Then use Apache or ngnix to reverse proxy to the node sites. The url rewrite rules are similar. See the docs for the proxy you pick.
Google for lots of examples