Embedding as a library , I turned on the sbt-web plugin in my project and launched web-stage , making the assets copied verbatim to target/web/stage/ . However, using the Play Framework DSL line interpolation routing as follows, they are not serviced when a compliance request arrives:
object PlayServer extends App { val server = NettyServer.fromRouter() { case GET(p"/public/$file*") => { val path = "/target/web/stage" Assets.at(path = path, file = file) } }
Debugging through the replay code processing Assets.at , it seems that nothing leads to the fact that the assets become resources in target/scala-2.11/classes/ , where they supposedly play the framework trying to load them as resources. Running sbt web-stage does not concern this.
So, what is not enough to manage sbt-web to take care of placing assets there? When manual installation is there, integration works !! therefore it seems that sbt-web in its default configuration puts assets in the wrong target subdirectory as far as Play is concerned ...
Please note that in plugins.sbt I only include the following from sbt-web, should it be enough?
addSbtPlugin("com.typesafe.sbt" % "sbt-web" % "latest.release")
source share