Reputation: 1161
I have a javascript file at public/javascripts/test.js of play framework. I want to replace the @serverURL with something like http://example.com/ when play framework is started. Is there a way for me to do that?
var serverURL = @serverURL;
Upvotes: 0
Views: 80
Reputation: 9168
I don't think you can have such substitution in Play public assets.
Instead I would have something like following in the view (e.g. file.html.scala
):
<script type="text/javascript">var serverURL="@serverURL"</script>
<script src="public/javascripts/test.js"></script>
Upvotes: 2