play-miniアプリケーションから画像を提供しようとしています。
object App extends Application {
def route = {
case GET(Path("/image")) => Action { request =>
Ok( Source.fromInputStream(getClass.getResourceAsStream("image.gif")).toArray ).as("image/gif")
}
}
}
残念ながら、これは機能しません:)次のエラーが発生します
Cannot write an instance of Array[Char] to HTTP response. Try to define a Writeable[Array[Char]]