Reputation: 5836
I would like to embed a Play based application in my own system, similar to what I am capable to do with Jetty. To simplify - instead of running start
script I would prefer to have a start()
method.
To be a little bit more descriptive let's assume that I have this scenario:
Is this scenario possible at all?
Upvotes: 6
Views: 1464
Reputation: 29433
You can launch a Play server programmatically using the NettyServer
class:
https://github.com/playframework/Play20/blob/2.0.4/framework/src/play/src/main/scala/play/core/server/NettyServer.scala
Like:
NettyServer.createServer(new File("/path/to/app"))
Upvotes: 4