search

Home  >  Q&A  >  body text

javascript - express routing problem

First determine whether there is a cookie, if not, render login_index
There is a form in login_index to submit a post request api/user/login,
Click the submit button, why can't the route be routed to app.use('api' ,xxx)? Through console.log, we know that the content in the if in else is indeed executed

过去多啦不再A梦过去多啦不再A梦2738 days ago382

reply all(2)I'll reply

  • 大家讲道理

    大家讲道理2017-05-19 10:42:21

    reply
    0
  • 滿天的星座

    滿天的星座2017-05-19 10:42:21

    You must use app.use吗?
    正常来写app.use('/api')应该写在这个中间件的下面,然后这里应该写res.redirect to jump here

    reply
    0
  • Cancelreply