随笔分类 -  node

摘要:l什么是cookie •页面用来保存信息 –比如:自动登录、记住用户名 •cookie的特性 –同一个网站中所有页面共享一套cookie –数量、大小有限 –过期时间 •JS中使用cookie –document.cookie lcookie的使用 •设置cookie –格式:名字=值 –不会覆盖 阅读全文
posted @ 2020-11-09 19:03 distant-遥远 阅读(100) 评论(0) 推荐(0)
摘要:https://www.npmjs.com/package/alipay-mobile 阅读全文
posted @ 2020-03-09 19:02 distant-遥远 阅读(206) 评论(0) 推荐(0)
摘要:const express =require('express') const path=require('path') const template=require('art-template') const app =express() //设置模板引 ,view文件 art后缀 app.set('view engine','art') //使用express兼容art-template模板引 阅读全文
posted @ 2019-12-29 12:21 distant-遥远 阅读(257) 评论(0) 推荐(0)
摘要:创建public文件夹放入html文件 <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <title>Document</title> </head> </html><!DOCTYPE html> <html lang=" 阅读全文
posted @ 2019-12-28 17:48 distant-遥远 阅读(247) 评论(0) 推荐(0)
摘要:// 路由,(根据请求路径和请求方式进行路径的分发处理) // http 的常用请求方式 // post 添加 // get 查询 // put 更新 // delete 删除 // restful api (一种url的格式) const express =require('express'); const app=express(); // ap... 阅读全文
posted @ 2019-12-28 14:57 distant-遥远 阅读(193) 评论(0) 推荐(0)
摘要:const express =require('express'); const app=express(); //实现静态资源服务 let server=app.use(express.static('public')); server.listen(3000,()=>{ console.log( 阅读全文
posted @ 2019-12-28 14:28 distant-遥远 阅读(187) 评论(0) 推荐(0)
摘要:var express =require('express'); var app=express(); app.get('/',function(req,res){ res.send('Hello wold'); }); var server =app.listen(3000,function(){ var host=server.address().address; var port=serve 阅读全文
posted @ 2019-12-28 14:19 distant-遥远 阅读(1065) 评论(0) 推荐(0)
摘要:文件结构图 { "next":"b.json", "msg":"this is a" } { "next":"c.json", "msg":"this is b" } { "next":"null", "msg":"this is c" } 上一层 阅读全文
posted @ 2019-12-06 11:45 distant-遥远 阅读(495) 评论(0) 推荐(0)
摘要:学习搭建服务器可用postman 连接不了localhost的端口 网上好多教程是这样连接 看完视频后我们是这样 找了大量资料都解决不了,什么版本,什么证书的都不好使,最简单的就是去掉http:// //get 测试 const http=require('http') const querystr 阅读全文
posted @ 2019-12-05 17:20 distant-遥远 阅读(6641) 评论(0) 推荐(2)
摘要://nodejs 处理post请求 // 异步 const http =require('http') const server=http.createServer((req,res)=>{ if(req.method=='POST'){ let postData='' req.on('data',chunk=>{ postData +=chunk.tostring() }) req.on('en 阅读全文
posted @ 2019-12-04 14:36 distant-遥远 阅读(581) 评论(0) 推荐(0)
摘要:http querystring 要从查询字符串中提取参数,可以使用 require('querystring').parse 函数,或者可以将 true 作为第二个参数传递给 require('url').parse: 阅读全文
posted @ 2019-12-04 13:41 distant-遥远 阅读(157) 评论(0) 推荐(0)