0
点赞
收藏
分享

微信扫一扫

基本路由的概念


基本路由

路由:

  • 请求方法
  • 请求路径
  • 请求处理函数

get:

//当你以get方法请求/的时候,执行对应的处理函数
app.get('/',function(req,res){
res.send('hello world');
})

post:

//当你以post方法请求/的时候,执行对应的处理函数
app.post('/',function(req,res){
res.send('hello world');
})


举报

相关推荐

0 条评论