Łukasz Rżanek
Łukasz Rżanek

Reputation: 5836

Embedding Play application in custom system

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

Answers (1)

James Ward
James Ward

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

Related Questions