|
@@ -13,19 +13,19 @@ object Main {
|
|
.withRequestHandler(req =>
|
|
.withRequestHandler(req =>
|
|
if (req.method == Method.GET && req.path == "/plaintext")
|
|
if (req.method == Method.GET && req.path == "/plaintext")
|
|
req.send(
|
|
req.send(
|
|
- statusCode = 200,
|
|
|
|
|
|
+ statusCode = StatusCode.OK,
|
|
content = "Hello, World!",
|
|
content = "Hello, World!",
|
|
headers = Seq("Content-Type" -> "text/plain")
|
|
headers = Seq("Content-Type" -> "text/plain")
|
|
)
|
|
)
|
|
else if (req.method == Method.GET && req.path == "/json")
|
|
else if (req.method == Method.GET && req.path == "/json")
|
|
req.send(
|
|
req.send(
|
|
- statusCode = 200,
|
|
|
|
|
|
+ statusCode = StatusCode.OK,
|
|
content = stream(Message("Hello, World!")),
|
|
content = stream(Message("Hello, World!")),
|
|
headers = Seq.empty
|
|
headers = Seq.empty
|
|
)
|
|
)
|
|
else
|
|
else
|
|
req.send(
|
|
req.send(
|
|
- statusCode = 404,
|
|
|
|
|
|
+ statusCode = StatusCode.NotFound,
|
|
content = "Not found",
|
|
content = "Not found",
|
|
headers = Seq("Content-Type" -> "text/plain")
|
|
headers = Seq("Content-Type" -> "text/plain")
|
|
)
|
|
)
|