标签:node ons password local get请求 expr list code 请求方式
const express = require("express");
const app = express();
app.listen(8080);
/**
 * 请求方式一
 *  http://localhost:8080/reg?username=zhangsan&password=123456
 */
app.get("/reg",(req,res)=>{
    const {username,password} = req.query;
    console.log(username,password);
})
/**
 * 请求方式二
 *  http://localhost:8080/login/zhangsan/123456
 */
app.get("/login/:username/:password",(req,res)=>{
    const {username,password} = req.params;
    console.log(username,password);
})
标签:node ons password local get请求 expr list code 请求方式
原文地址:https://www.cnblogs.com/Listener-wy/p/14863995.html