Add ui component - #4
Conversation
|
Cool. Could you please ensure your project stucture conform existing in repository? |
|
I'm so sorry. I'll fix it. Thanks) |
|
Thank you Valentine for your comments, i've fixed corresponding |
| path("home") { | ||
| get { | ||
| respondWithMediaType(MediaTypes.`text/html`) { | ||
| val homePage = Source.fromURL(this.getClass.getResource("/index.html")).mkString |
There was a problem hiding this comment.
Why do you serve all your static data through api module?
api and client should be independent applications. You can also have multiple different clients that work with the same api.
I would recommend to serve it using some http server like nginx instead.
# Conflicts: # README.md # api/build.sbt # api/src/main/scala/scalalab3/lyricsengine/Boot.scala
# Conflicts: # README.md # api/build.sbt # api/src/main/scala/scalalab3/lyricsengine/Boot.scala
Move client files around
| pathPrefix("js") { | ||
| get { | ||
| getFromResourceDirectory("js") | ||
| } |
There was a problem hiding this comment.
Сервинг статики хорошо бы отделить от бизнес-логики. В идеале скала вообще не должна её сёрвить, это лучше поручить какому nginx-у. Ну или хотя бы отделить в отдельный роут.
There was a problem hiding this comment.
Да, извините, это уже пофиксано. ui component отдельный модуль ни от чего не зависящий
# Conflicts: # README.md # api/build.sbt # api/src/main/scala/scalalab3/lyricsengine/Boot.scala
No description provided.