nodejs-日常练习记录-使用express搭建static服务器.

cd C:wxg	est
ode_demomyapp
nvmw use 0.12.1
node static.js

var express = require('express');

var app = express();


var subApp = express();
subApp.get('/', function(req, res, next){
	res.send('Hello, Welcome!');
	console.log(111);
	next();
});

app.use(subApp);

app.use('/easyui',express.static('./web/public/easyui/static'));
app.use('/easyui_lib',express.static('./web/libs/jquery-easyui'));


app.listen(3000, function(req, res){
	console.log('http://localhost:3000');
	console.log('app is running at port 3000');
});

访问 http://localhost:3000/easyui/hello.html 能够看到使用easyui制作的helloworld界面

原文地址:https://www.cnblogs.com/juedui0769/p/4948884.html