search

Home  >  Q&A  >  body text

javascript - react uses ant Design. How to put packaged static files on express

I used ant design to create a single-page application that uses a lot of routing functions. How should I deploy it to express

为情所困为情所困2795 days ago559

reply all(3)I'll reply

  • 世界只因有你

    世界只因有你2017-05-19 10:45:27

    Express’ built-in express.static can easily host static files, such as images, CSS, JavaScript files, etc. The specific method is to add an express middleware.

        app.use(express.static(path.join(__dirname, "你的打包后react项目路径")))

    reply
    0
  • 大家讲道理

    大家讲道理2017-05-19 10:45:27

    Did you use Universal rendering? After accessing the listening port, wouldn’t it be enough to directly send the entry file?

    reply
    0
  • 怪我咯

    怪我咯2017-05-19 10:45:27

    I know, it turns out that I used browserHistory and I couldn’t do anything. If I used browserHistory or hashHistory

    reply
    0
  • Cancelreply