import net.liftweb.http.rest._
object MyCSSMorpher extends RestHelper {
serve {
case r @ Req("dynocss" :: file :: _, "css", GetRequest) =>
for {
convertFunc <- findConvertFunc(r)
fileContents <- readFile(file+".css")
converted <- convertFunc(fileContents)
} yield CSSResponse(converted)
}
// based on the browser detected, return a function
// that will convert HTML5 css into CSS for that browser
def findConvertFunc(req: Req): Box[String => Box[String]] =
Empty
// load the file from the specific location...
// are you going put the CSS templates in
// resources, etc.
def readFile(name: String): Box[String] = Empty
}