search

Home  >  Q&A  >  body text

node.js - nodejs+express+vue

如果用nodejs+express+vue.js开发的
要怎么选择路由?是选择express提供的路由还是vue.js提供的路由

天蓬老师天蓬老师2782 days ago778

reply all(3)I'll reply

  • 天蓬老师

    天蓬老师2017-04-17 15:05:36

    Although they are both called routing, their starting points are different!
    Express routing is normal routing from domain.com/users
    , while vuejs routing is from domain.com/#users
    # is the root of vuejs and the root of express is / (of course all back-end languages The roots are also /)

    express example (get user information):
    domain.com/users/1000

    vuejs example (get user information)
    domain.com/#users/1000

    reply
    0
  • PHPz

    PHPz2017-04-17 15:05:36

    What the two don’t want to do is that vue’s routing is front-end routing, which is the routing in single-page applications. The route in express is the path to the file or api interface on the server.

    reply
    0
  • PHP中文网

    PHP中文网2017-04-17 15:05:36

    Vue is a front-end routing, express is a back-end routing, and the idea of ​​​​vue is to separate the front and back ends. The back end only needs to provide the index.html entry, and other data is obtained through express's routing interface

    reply
    0
  • Cancelreply