在Lapis上用moonscript渲染和接收json

编辑整理:糖果

lapis = require "lapis"                                                                                                                                                   
import json_params from require "lapis.application"                                                                                                                       
                                                                                                                                                                          
class App extends lapis.Application                                                                                                                                       
  "/": =>                                                                                                                                                                 
    {                                                                                                                                                                     
      json: {                                                                                                                                                             
        success: true                                                                                                                                                     
        message: "hello world"                                                                                                                                            
      }                                                                                                                                                                   
    }                                                                                                                                                                     
  "/json": json_params =>                                                                                                                                                 
    @params.value    

用curl进行测试:

curl -H "Content-type: application/json"  -d '{"value": "hello"}'  0.0.0.0:8080/json

糖果

糖果
LUA从入门到放弃

Tweyseo Walkonluajit 1

# **0. 背景**## **a. 目的**这里主要研究LuaJIT的Trace的相关原理,并且展示如何使用LuaJIT提供的[v.lua](https://github.com/LuaJIT/LuaJIT/blob/master/src/jit/v.lua)和[dump...… Continue reading

Nginx+Lua中文WIKI

Published on March 14, 2019