1. <strong id="7actg"></strong>
    2. <table id="7actg"></table>

    3. <address id="7actg"></address>
      <address id="7actg"></address>
      1. <object id="7actg"><tt id="7actg"></tt></object>

        LuvitLua實(shí)現(xiàn)的Node.js

        聯(lián)合創(chuàng)作 · 2023-09-30 05:19

        Luvit - Lua + UV + Jit = NodeJS re-implemented in Lua

        如上面標(biāo)題所描述的,Luvit 相當(dāng)于 luajit2 + libuv,編譯成單個(gè)可執(zhí)行文件,類似 Node.js ,可運(yùn)行 .lua 文件。

        示例代碼(創(chuàng)建一個(gè)HTTP服務(wù)器)

        -- Load the http library
        local HTTP = require("lib/http")
        
        -- Create a simple nodeJS style hello-world server
        HTTP.create_server(function (req, res)
          res:write_head(200, {
            ["Content-Type"] = "text/plain",
            ["Content-Length"] = "11"
          })
          res:write("Hello World")
          res:finish()
        end):listen(8080)
        
        -- Give a friendly message
        print("Server listening at http://localhost:8080/")


        瀏覽 21
        點(diǎn)贊
        評(píng)論
        收藏
        分享

        手機(jī)掃一掃分享

        編輯 分享
        舉報(bào)
        評(píng)論
        圖片
        表情
        推薦
        點(diǎn)贊
        評(píng)論
        收藏
        分享

        手機(jī)掃一掃分享

        編輯 分享
        舉報(bào)
        1. <strong id="7actg"></strong>
        2. <table id="7actg"></table>

        3. <address id="7actg"></address>
          <address id="7actg"></address>
          1. <object id="7actg"><tt id="7actg"></tt></object>
            欧美成人性另类在线视频 | 看黄色毛片 | 一本无码视频 | 日本天天综合网 | 亚洲无码电影院 | 欧美特级黄 | 女人的呻吟声 | 国产精品久久久久久久久久不蜜月 | 777黄色| 国产露脸150部国语对白 |