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);
})