search

Home  >  Q&A  >  body text

node.js - vue-cli webpack express配置服务端路由规则

PHP中文网PHP中文网2873 days ago512

reply all(1)I'll reply

  • ringa_lee

    ringa_lee2017-04-17 15:46:36

    There is no problem with this configuration.

    // serve webpack bundle output
    app.use(devMiddleware)
    
    // enable hot-reload and state-preserving
    // compilation error display
    app.use(hotMiddleware)
    
    app.use('/', routes);

    By doing this, the above codes will be processed in order. The two middlewares devMiddleware and hotMiddleware are added by default in vue-cli, which can be adjusted and used as needed.

    reply
    0
  • Cancelreply