The following is possible using Python:
$ apt-get install python
$ easy_install Flask
$ cat > hello.py
from flask import Flask
app = Flask(__name__)
@app.rou
As David Winslow mentioned, Unfiltered usage code snippet
INFO: Simple API capabilities for Apache Spark word count example written in Scala using Unfiltered.
object SimplePlan extends Plan {
def intent = {
case req @ GET(Path("/get")) => {
Ok ~> ResponseString(WordCount.count("Test #1: Test the Default word count program").mkString("\n"));
}
case req @ POST(Path("/get_custom")) => {
val custom_string = Body.string(req)
Ok ~> ResponseString(WordCount.count(custom_string).mkString("\n"))
}
}
}
object SimpleServer extends App {
val bindingIP = SocketPortBinding(host = "localhost", port = 8080)
unfiltered.jetty.Server.portBinding(bindingIP).plan(SimplePlan).run()
}
Complete example is here