在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教程

浅析深度学习神经网络的卷积层

浅析深度学习神经网络的卷积层 Continue reading

NC的文件复制功能

Published on October 10, 2019

Django时区与数据库被锁

Published on October 08, 2019