Thanks for the tips.
I chose the following solution to solve my problem:
1. Have a dynamic route to serve xyz.scala.html files.
* In routes I added: GET /*file controllers.Application.serveFile(file)
* with a corresponding serveFile method (that mimics S3 static website behaviour):
def serveFile(pathToFile:String)=Action { request=>
val objectName:String="views.html."+(pathToFile.matches(".+\\.html$") match {
case true=> pathToFile.replaceAll("\\.html$","").replace('/', '.')+"$"
case _=> pathToFile.replaceAll("/$", "").replace('/', '.')+".index$"
})
try {
val fileObject=Class.forName(objectName).getField("MODULE$").get(null).asInstanceOf[{ def apply() : play.api.templates.Html }]
Ok(fileObject())
} catch {
case _=> NotFound
}
}
2. I added a script to extract files while play is running. The script reads the list of resources to extract from a file (site-files.txt):
#!/bin/bash
if [ "x$1" = "x" ]; then
echo "Need to Specify the directory to extract to"
exit 1
fi
FILE="conf/site-files.txt"
while read LINE; do
FILENAME=$(basename $LINE)
PATHNAME=${LINE%%$FILENAME}
rm $1$LINE
wget -nv -P $1$PATHNAME http://localhost:9988$LINE
done < "$FILE"
CPC.