hello.nim 263 B

123456789
  1. import jester, strtabs, json, asyncio, sockets, os, strutils
  2. get "/json":
  3. var obj = %{"message": %"Hello, World!"}
  4. resp($obj, "application/json")
  5. var disp = newDispatcher()
  6. disp.register(port = TPort(paramStr(1).parseInt), http=false)
  7. while disp.poll(): nil