diff --git "a/\346\236\227\345\271\274\350\212\263/2022.3.13--\346\220\255\345\273\272web\346\234\215\345\212\241\345\231\250\350\216\267\345\217\226\351\235\231\346\200\201\350\265\204\346\272\220/home/index.html" "b/\346\236\227\345\271\274\350\212\263/2022.3.13--\346\220\255\345\273\272web\346\234\215\345\212\241\345\231\250\350\216\267\345\217\226\351\235\231\346\200\201\350\265\204\346\272\220/home/index.html" new file mode 100644 index 0000000000000000000000000000000000000000..73257603465a16f677722067b451aef1b45bbbe9 --- /dev/null +++ "b/\346\236\227\345\271\274\350\212\263/2022.3.13--\346\220\255\345\273\272web\346\234\215\345\212\241\345\231\250\350\216\267\345\217\226\351\235\231\346\200\201\350\265\204\346\272\220/home/index.html" @@ -0,0 +1,12 @@ + + + + + + + Document + + +

我是首页

+ + \ No newline at end of file diff --git "a/\346\236\227\345\271\274\350\212\263/2022.3.13--\346\220\255\345\273\272web\346\234\215\345\212\241\345\231\250\350\216\267\345\217\226\351\235\231\346\200\201\350\265\204\346\272\220/images/404.png" "b/\346\236\227\345\271\274\350\212\263/2022.3.13--\346\220\255\345\273\272web\346\234\215\345\212\241\345\231\250\350\216\267\345\217\226\351\235\231\346\200\201\350\265\204\346\272\220/images/404.png" new file mode 100644 index 0000000000000000000000000000000000000000..f321cf90fd415d14b4afcf69fea661334772cb10 Binary files /dev/null and "b/\346\236\227\345\271\274\350\212\263/2022.3.13--\346\220\255\345\273\272web\346\234\215\345\212\241\345\231\250\350\216\267\345\217\226\351\235\231\346\200\201\350\265\204\346\272\220/images/404.png" differ diff --git "a/\346\236\227\345\271\274\350\212\263/2022.3.13--\346\220\255\345\273\272web\346\234\215\345\212\241\345\231\250\350\216\267\345\217\226\351\235\231\346\200\201\350\265\204\346\272\220/index.js" "b/\346\236\227\345\271\274\350\212\263/2022.3.13--\346\220\255\345\273\272web\346\234\215\345\212\241\345\231\250\350\216\267\345\217\226\351\235\231\346\200\201\350\265\204\346\272\220/index.js" new file mode 100644 index 0000000000000000000000000000000000000000..5770878850fa6c40a630895200031f3c9d0613d4 --- /dev/null +++ "b/\346\236\227\345\271\274\350\212\263/2022.3.13--\346\220\255\345\273\272web\346\234\215\345\212\241\345\231\250\350\216\267\345\217\226\351\235\231\346\200\201\350\265\204\346\272\220/index.js" @@ -0,0 +1,52 @@ +//引入模块 +let http=require('http'); +let fs=require('fs'); + + + +//创建web服务 +http.createServer(function(req,res){ + let url=req.url; + //静态资源 + if(url.lastIndexOf('.')>-1){ + let path='.'+url; + + fs.exists(path,function(result){ + if(!result){ + path='./home/images/404.png' + } + fs.readFile(path,function(err,data){ + if(err){ + res.end("err.message"); + }else{ + res.end("data"); + } + }) + }) + } +}).listen(8080,function(){ + console.log('服务启动请访问:http://127.0.0.1:8080'); +}); + +// let promise= function(filename){ + +// return new Promise(function(resolve,reject){ + +// fs.exists(filename,function(result){ +// if(!result){ +// filename='./home/imgs/404.png'; +// } +// fs.readFile(filename,function(err,data){ +// resolve(data); +// }) +// }) +// }) +// } + +// async function readFileByPromise(fileName,res) { +// let data = await promise(fileName); +// res.write(data); +// res.end(); +// } + + diff --git "a/\346\236\227\345\271\274\350\212\263/2022.3.8--mysql/workspace.code-workspace" "b/\346\236\227\345\271\274\350\212\263/2022.3.8--mysql/workspace.code-workspace" new file mode 100644 index 0000000000000000000000000000000000000000..dd4edb66bc6771bc6f0486ed4172c52403c999a2 --- /dev/null +++ "b/\346\236\227\345\271\274\350\212\263/2022.3.8--mysql/workspace.code-workspace" @@ -0,0 +1,6 @@ +{ + "folders": [], + "settings": { + "liveServer.settings.multiRootWorkspaceName": "2022.3.6--http优化" + } +} \ No newline at end of file