In order to have a clean directory structure, I would like to make an additional assets folder public. I've created a directory 'assets' in my project folder, wrote an 'PictureAssets' controller which is nearly identical to 'controller.Assets', added 'assets' to the playAssetsDirectories in the build.sbt and tried following some route entries without success.
PictureAssets:
package controllers
import play.api.mvc.Action
import play.api.mvc.AnyContent
object PictureAssets extends AssetsBuilder {
def create : Action[AnyContent] = Action {
Ok(views.html.fileUploadForm())
}
}
build.sbt
playAssetsDirectories <+= baseDirectory / "assets"
routes
# GET /file controllers.PictureAssets.at(path="/assets", file="MM1.png")
GET /datei/*file controllers.PictureAssets.at(path="/assets", file)
# GET /datei/*file controllers.Assets.at(path="/assets", file)
If I try to access the URL, either nothing is displayed, or the error 'The image http:9000//localhost/datei/MM1.png cannot be displayed because it contains errors' is displayed or the css references to handled by the 'controller.Assets' don't work any more.
What am I missing?