diff --git a/test1/demo6/app.js b/test1/demo6/app.js index 085dcf6..bcedf03 100644 --- a/test1/demo6/app.js +++ b/test1/demo6/app.js @@ -1,5 +1,6 @@ var express=require('express'); var fs=require('fs'); +var path=require('path'); var app=express(); app.get('/',function(req,res){ // res.send('响应用户请求'); @@ -34,7 +35,7 @@ app.use('/test',function(req,res){ // res.send(req.params); // }) //加载静态资源 -app.use('/public',express.static('public')); -app.listen(8080,function(){ +app.use('/public',express.static(path.join(__dirname,'public'))); +app.listen(8088,function(){ console.log('服务器已经启动!') }) \ No newline at end of file diff --git a/test1/demo6/index.html b/test1/demo6/index.html index 5fd434b..5c1c2b1 100644 --- a/test1/demo6/index.html +++ b/test1/demo6/index.html @@ -5,7 +5,7 @@
+