+doc add Java testkit documentation and scaladoc
This commit is contained in:
parent
f889112096
commit
4c24b72b31
7 changed files with 237 additions and 4 deletions
|
|
@ -0,0 +1,33 @@
|
|||
/*
|
||||
* Copyright (C) 2009-2015 Typesafe Inc. <http://www.typesafe.com>
|
||||
*/
|
||||
|
||||
package docs.http.javadsl.testkit;
|
||||
|
||||
//#simple-app
|
||||
import akka.http.javadsl.server.*;
|
||||
import akka.http.javadsl.server.values.Parameters;
|
||||
|
||||
public class MyAppService extends HttpApp {
|
||||
RequestVal<Double> x = Parameters.doubleValue("x");
|
||||
RequestVal<Double> y = Parameters.doubleValue("y");
|
||||
|
||||
public RouteResult add(RequestContext ctx, double x, double y) {
|
||||
return ctx.complete("x + y = " + (x + y));
|
||||
}
|
||||
|
||||
@Override
|
||||
public Route createRoute() {
|
||||
return
|
||||
route(
|
||||
get(
|
||||
pathPrefix("calculator").route(
|
||||
path("add").route(
|
||||
handleReflectively(this, "add", x, y)
|
||||
)
|
||||
)
|
||||
)
|
||||
);
|
||||
}
|
||||
}
|
||||
//#simple-app
|
||||
Loading…
Add table
Add a link
Reference in a new issue