Tag: iis 8

在iisnode的web.config for Express中设置规则

在iisnode中提供的例子只处理一个文件(比如hello.js),并且在web.config文件中设置了一个规则: <!– indicates that the hello.js file is a node.js application to be handled by the iisnode module –> <handlers> <add name="iisnode" path="hello.js" verb="*" modules="iisnode" /> </handlers> <rewrite> <rules> <rule name="myapp"> <match url="myapp/*" /> <action type="Rewrite" url="hello.js" /> </rule> </rules> </rewrite> 当处理普通的快速应用程序时,我们应该使用bin/www作为默认启动。 我目前只是replacebin/www hello.js ,是这样做的正确方法?

iisnode不会运行Express

我试图运行使用iisnode快递。 我遵循了所提供的示例,但是当尝试使用最新的Express版本和基本示例时,无法使其工作。 我得到的错误Cannot GET /node/parislight/hello.js和其他时间,只是一个The webpage cannot be found 。 我创build了一个hello.js文件(主要快速文件)从快速文档取自。 var express = require('express') var app = express() app.get('/', function (req, res) { res.send('Hello World!') }) var server = app.listen(process.env.PORT, function () { var host = server.address().address var port = server.address().port console.log('Example app listening at http://%s:%s', host, port) }) 我添加了必要的web.config文件(从iisnode中的快速示例中提取) <configuration> <system.webServer> <!– indicates […]

在Asp.Net MVC应用程序的VirtualDirectory中使用IISNode在IIS内托pipeSocket.IO + ExpressJS应用程序

我有一个ASP.NET MVC 5应用程序和一个NodeJs(Express + Socket.IO)应用程序。 在业务场景中,我必须在MVC应用程序内运行NodeJS应用程序作为子目录。 对于。 例如, MVC: http : //foo.com NodeJS: http : //foo.com/node 我使用IISNode(最新版本)在IIS 8中托pipe了这两个应用程序。 这两个应用程序都使用websockets。 Asp.net应用程序利用SignalR和NodeJS利用Socket.IO.I已经在https://github.com/tjanczuk/iisnode上提供了相关文档。 问题是当socket.io.js在客户端加载并尝试连接到服务器时,它返回404-Not Found结果。 我已经为Node应用程序的两个应用程序和server.js附加了web.config。 我怀疑问题是与URL重写。 这里是server.js // Load required modules var http = require("http"); // http server core module var express = require("express"); // web framework external module var io = require("socket.io"); // web socket external […]