问题
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 Angular app through Wakanda. (I suppose I could just as easily use Apache but Wakanda has a web server so why not use it?)
The problem is I don't know how to publish the app with Wakanda. I tried putting the 'dist' files in the web folder but Wakanda keeps saying "Service Not Available".
Any thoughts would be much appreciated.
回答1:
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 onweb
folder, then selectopen in terminal
- Run
npm run build
. Adist
folder is created - Move the
dist
folder into thebackend
project - In studio, set the
dist
folder in thebackend
project as theWebFolder
. Right click on it, then selectset 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
来源:https://stackoverflow.com/questions/45071913/how-to-serve-static-files-in-wakanda-v2