I'm trying some server-side rendering with scala, play framework and react.js

At the moment I can render js from scala using js-engine (https://github.com/typesafehub/js-engine) but I want to give the js code some arguments (so I can do routing). This is what I have:

def app(route: String) = serverSideWithJsEngine(Trireme.props(), route) private def serverSideWithJsEngine(jsEngine: Props, route: String) = Action.async { request => import akka.pattern.ask val serverside=Play.getFile("target/web/public/main/serverSide.js") implicit val timeout = Timeout(5.seconds) val engine = Akka.system.actorOf(jsEngine, s"engine-${request.id}") for { result <- (engine ? Engine.ExecuteJs( source = new File(serverside.toURI), args = List(route), timeout = timeout.duration )).mapTo[JsExecutionResult] } yield { Ok(views.html.app(Html(new String( result.output.toArray, "UTF-8") ))) } }

This code renders the app but in theory, args = List(route) should give me "route" in the process.argv array from JS but I get an empty array.

Maybe is a bug from js-engine not passing args?? I don't understand why this code doesn't work...

Thanks!