10 2022 档案
get/post rest
摘要:get:用来搜索 post:用来添加或删除 rest 例子: 第二个是删除指定用户。@PathVariable 是路径变量,代表从路径里取值 @RequestBody 接请求体参数,接json,多个数据 @RequestParam 接路径,用来表单提交 @PathVariable 接单个数据 res
阅读全文
模板(ejs) render,传入ejs文件显示
摘要:js: const express=require('express'); const app=express(); app.set('view engine','ejs'); app.get('/',(req,res)=>{ res.render("h"); return; }) app.list
阅读全文
express
摘要:const express=require("express"); const app=express(); console.dir(app); app.use(()=>{ console.log("we have a new request") } ) app.listen(8080,()=>{
阅读全文
ajax (和服务器交换数据
摘要:直接把这段代码放在html的script里面:
阅读全文
Fetch and axios
摘要:例子: 后台接收: 前台写axios: 用别名:
阅读全文