(二)nimlang web开发 hello world jester

       首先,咱们须要一个第三方的库:jester(https://github.com/dom96/jester)。nim-lang的官方网也是用它来写的。html

其实,浏览过nimlang官方网的朋友,就会发现,上面有一个简单的web例子。git

webHW.nim代码:github

# a simple html server
import
  jester, asyncdispatch, htmlgen

routes:
  get "/":
    resp h1("Hello world 2016-05-01")

runForever()

import了三个mod。其中asyncdispatch, htmlgen是标准库。web

项目目录结构:dom

敲指令: nim c webHW.nimasync

最后:spa

相关文章
相关标签/搜索