浏览代码

Fix nim consts for json tests (#4803)

Nate 6 年之前
父节点
当前提交
e2838399f5
共有 2 个文件被更改,包括 4 次插入4 次删除
  1. 2 2
      frameworks/Nim/httpbeast/techempower.nim
  2. 2 2
      frameworks/Nim/jester/techempower.nim

+ 2 - 2
frameworks/Nim/httpbeast/techempower.nim

@@ -6,7 +6,7 @@ proc onRequest(req: Request): Future[void] =
   if req.httpMethod == some(HttpGet):
     case req.path.get()
     of "/json":
-      const data = $(%*{"message": "Hello, World!"})
+      var data = $(%*{"message": "Hello, World!"})
       const headers = "Content-Type: application/json"
       req.send(Http200, data, headers)
     of "/plaintext":
@@ -16,4 +16,4 @@ proc onRequest(req: Request): Future[void] =
     else:
       req.send(Http404)
 
-run(onRequest)
+run(onRequest)

+ 2 - 2
frameworks/Nim/jester/techempower.nim

@@ -7,9 +7,9 @@ settings:
 
 routes:
   get "/json":
-    const data = $(%*{"message": "Hello, World!"})
+    var data = $(%*{"message": "Hello, World!"})
     resp data, "application/json"
 
   get "/plaintext":
     const data = "Hello, World!"
-    resp data, "text/plain"
+    resp data, "text/plain"