How do you use the playback platform as a library in a scala project

Using the Play Framework as a component got the server up, but it configures the file system paths for route files, views, etc., gives or takes care of the thread pool for the built-in game server - that's another story. Based on the foregoing, I launched a template to enable playback as a library , but it remains unclear how to connect paths, I hope in the IDE -import friendly way too, so that Play can be used well in an existing project without a game, like in a library.

  • How do you configure file system paths for file routes and views?
  • What else needs to be processed in order to be as reliable as working with infrastructure?
  • Anything special to integrate your deployment project with Play now included?

Motivation: adding playback to the project in the current state of affairs means transferring the definition and structure of the project around Play and losing the full compilation to sbt (because only run completes the compilation using the sbt plugin for playback), since future Spray support is uncertain, and Akka http - beta ish, using Play as a library seems to plug a hole.

+6
source share
1 answer

Somehow this did not appear on google until someone suggested a link to gitter: https://www.playframework.com/documentation/2.5.x/ScalaEmbeddingPlay

Please note: the application.conf file containing the required secret key can simply be located under src/main/resources in this built-in mode (until you want to redefine it for production in accordance with the documentation about it ). This is sufficient for the REST server.

However, now back to the docs if you want more than REST:

This can be used in conjunction with the Twirl template compiler and the Play routes compiler.

So, for Play Play templates (which really are vertex templates), refer to the repo, which I mention in the body of the question, in which @JonasAnso kindly resolved just that.

+3
source

All Articles