diff --git "a/20230216-\346\250\241\345\235\227\350\257\273\345\206\231.md" "b/\345\262\221\345\234\243\345\261\261/20230216-\346\250\241\345\235\227\350\257\273\345\206\231.md" similarity index 100% rename from "20230216-\346\250\241\345\235\227\350\257\273\345\206\231.md" rename to "\345\262\221\345\234\243\345\261\261/20230216-\346\250\241\345\235\227\350\257\273\345\206\231.md" diff --git "a/\345\262\221\345\234\243\345\261\261/20230217-http\346\250\241\345\235\227.md" "b/\345\262\221\345\234\243\345\261\261/20230217-http\346\250\241\345\235\227.md" new file mode 100644 index 0000000000000000000000000000000000000000..ac570f619ad11fe6834f00d20b550c50c5aefb94 --- /dev/null +++ "b/\345\262\221\345\234\243\345\261\261/20230217-http\346\250\241\345\235\227.md" @@ -0,0 +1,27 @@ +## http模块 + +1、http协议 为请求/响应式的协议 +2、http协议常见方法有:get、post、put、delete、options +3、http的默认端口号是80 +4、默认的http是不安全的,是明文的 +5、后面新增加的https是安全的,是加密的 +6、websocket 简称ws是即时通信协议,其实也是基于http协议 + + +``` + +const { log } = require('console'); +//导入http模块 +const http = require('http'); +//创建app +let app = http.createServer((req,res)=>{ + res.end('hello,kangk') +}); + +//让服务器监听 +let poyt=80 +app.listen(poyt); + +console.log('服务器跑起来咯'); + +``` \ No newline at end of file