iisnode托管node
1、官方下载iisnode https://github.com/tjanczuk/iisnode
2、安装完成后在IIS中可见
3、在webconfig中设置处理
<system.webServer>
<handlers>
<!-- indicates that the server.js file is a node.js application to be handled by the iisnode module -->
<add name="iisnode" path="server.js" verb="*.js" modules="iisnode" />
</handlers>
</system.webServer>
4、一起来搭建我们的server.js吧!
var http = require('http'); var express = require('express'); http.createServer(function (req, res) { res.writeHead(200, {'Content-Type': 'text/plain'}); res.end('hello world'); }).listen(process.env.PORT);
5、赶快打开我们的server.js看看"hello world"吧