Fixed server code

This commit is contained in:
Felix Krause 2016-01-24 21:41:06 +01:00
parent a08f4c1e4e
commit cfe2f38899
1 changed files with 6 additions and 7 deletions

View File

@ -12,13 +12,13 @@ routes:
headers["Content-Type"] = "text/plain"
resp "I am a friendly NimYAML parser webservice."
post "/":
var style: YamlPresentationStyle
var style: PresentationStyle
case @"style"
of "minimal": style = ypsMinimal
of "canonical": style = ypsCanonical
of "default": style = ypsDefault
of "json": style = ypsJson
of "block": style = ypsBlockOnly
of "minimal": style = psMinimal
of "canonical": style = psCanonical
of "default": style = psDefault
of "json": style = psJson
of "block": style = psBlockOnly
var
output = newStringStream()
resultNode = newJObject()
@ -26,7 +26,6 @@ routes:
headers["Pragma"] = "no-cache"
headers["Cache-Control"] = "no-cache"
headers["Expires"] = "0"
echo "INPUT: ", @"input", "STYLE:", @"style"
try:
transform(newStringStream(@"input"), output, style)
resultNode["code"] = %0