☯️

openresty

openresty使用Lua开发简单功能页面

本文章记录使用lua开发简单API功能页. 前言 开发过程中遇到一些特别简单的接口需求,但是单独写一个api接口页面又很麻烦的需求,这个时候可以借助lua来实现. 思路 将简单api功能模块化,统一存放某个路径. 调用时判断模块是否存在,否则返回404. 架构 实现根据字符串加载模块 utils/tools.lua Tools = { _VERSION = "0.1" } -- 字符切割 function Tools:split(s, p) local rt = {} string. Read more...
1 of 1