Last active
January 11, 2017 18:28
-
-
Save drcharris/2e3518b212adfa1b6a7f to your computer and use it in GitHub Desktop.
DEPRECATED - see https://gist.github.com/cessationoftime/b304c13f810f9d52e32fbf6c778af3d9 for updated version. Use different assets for different configurations with Play Framework
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
... | |
assets.path="/public" | |
... |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package controllers | |
import play.api.Play | |
import Play.current | |
import play.api.mvc.Action | |
import play.api.mvc.AnyContent | |
object ConfigurableAssets extends AssetsBuilder { | |
private val assetsPath = Play.configuration.getString("assets.path").getOrElse("/public") | |
def at(file:String): Action[AnyContent] = { | |
at(assetsPath, file) | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
... | |
assets.path="/dist" | |
... |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#static files | |
GET /public/*file controllers.ConfigurableAssets.at(file) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment