demo

/**
 * Created by ZXW on 2017/11/6.
 */
var express=require("express");

var server=express();

server.use("/a.html",function(req,res) {
    res.send("cda");
    res.end();

});
server.use("/b.html",function(req,res) {
    res.send("abc");
    res.end();
});
server.listen(4000);

效果:

nodejs express的基本用法_html

 

越努力越幸运