How to serve static files in Wakanda v2

前端 未结 1 1730
南旧
南旧 2021-01-24 23:04

I\'ve been using Wakanda v2 server for a few months now. I\'m using Angular (v2+ not angularJS) for the front end.

I finally got to the point where I want to publish my

相关标签:
1条回答
  • 2021-01-24 23:40

    This feature is under hard work and schedule for the v2.2 release. In the meantime, you can do these steps manually:

    • Open the web folder in terminal. Right click on web folder, then select open in terminal
    • Run npm run build. A dist folder is created
    • Move the dist folder into the backend project
    • In studio, set the dist folder in the backend project as the WebFolder. Right click on it, then select set as active webfolder.

    You can have issue with the angular URL strategy. The # angular is not understood by Wakanda Server. Therefor, you can add useHash: true in the /src/app/app.module.ts.

    RouterModule.forRoot(routes, { useHash: true })

    Source: https://github.com/Wakanda/wakanda-issues/issues/137

    0 讨论(0)
提交回复
热议问题