1.server端 支持数学运算的服务器,服务器的返回结果用json对象表示. math-server.js //通过监听3000端口使其作为Math Wizard的后台程序 var math = require('../nodejsExample3/math.js'); var express = require('express'); var app = express(); app.configure(function(){ app.use(app.router); //默认的错误处理函数…
app-node.js ; var http = require('http'); var htutil = require('./htutil'); var server = http.createServer(function(req, res){ htutil.loadParams(req, res, undefined); if (req.requrl.pathname === '/'){ require('./home-node').get(req, res); }else if (r…