首页
Python
Java
IOS
Andorid
NodeJS
JavaScript
HTML5
【
lapis http verb 处理
】的更多相关文章
lapis http verb 处理
1. 同一个url 包含不同的请求(respond_to 进行解决) // 路由格式 match ,通过respond_to 进行实际的http verb 处理 local lapis = require("lapis") local respond_to = require("lapis.application").respond_to local app = lapis.Application() app:match("create_account&…
luarocks install with lua5.1 and luajit to install lapis
# in luarocks source directory...git clone https://github.com/archoncap/luarockscd luarocks ./configure --lua-version=5.1 --with-lua=/usr/ --with-lua-include=/usr/local/openresty/luajit/include/luajit-2.1 make build make installmake buildmake install…
lapis 项目添加prometheus 监控集成grafana
操作很简单,主要是进行界面的配置以及prometheus 服务的配置, 可以和https://www.cnblogs.com/rongfengliang/p/10074044.html && https://www.cnblogs.com/rongfengliang/p/10038706.html 结合起来看 环境准备 docker-compose version: "3" services: api: build: ./ ports: - "8080:808…
lapis 项目添加prometheus 监控
lapis 是基于openresty 扩展的,所以直接将支持prometheus的模块构建进openresty 就可以了 我使用的是nginx-module-vts 模块 环境准备 我已经构建好了支持的基础镜像,可以直接配置即可,具体的可以看下面的参考资料 docker-compose 文件 version: "3" services: api: build: ./ ports: - "8080:8080" volumes: - "./web:/web…
lapis 1.7.0 更好的openresty 版本兼容以及安全数据库支持
lapis 1.7.0 今年4月2号就发布了,一直没有注意,今天看到changelog就简单的进行了一个 测试(主要是与openresty版本的测试,新变更后边会有) 使用docker-compose 运行 环境准备 docker-compose 文件 version: "3" services: api: build: ./ ports: - "8080:8080" dockerfile FROM openresty/openresty:alpine-fat RU…
what is HTTP OPTIONS verb
The options verb is sent by browser to see if server accept cross origin request or not, this process is called "prefight".If the response contain the right header of CORS, then web browser will go ahead to send the real request to the resouce,…
lapis docker 运行说明
1. lapis docker 镜像制作 因为openresty 新版本一个json 库的问题,我们使用的是 openresty:1.11.2.1 基础镜像 FROM openresty/openresty:1.11.2.1-centos RUN yum install -y openssl-devel RUN /usr/local/openresty/luajit/bin/luarocks install luaossl && \ /usr/local/openresty/luajit/…
lapis 处理接收到的json 数据
备注: 在restful api 开发过程中,大家一般使用的都是json 格式的数据lapis 在处理json 数据上也是比较方便的 1. 使用的api 说明 local json_params = require("lapis.application").json_params 2. 参考代码 // app.lua app:match("/json", json_params(function(self) -- 只处理name…
luarocks yum 安装引起的lapis lua 包查找问题(centos7版本)
备注: 大家在进行lapis 开发的时候有些人比较懒直接使用yum 按照luarocks,之后 使用luarocks 安装lapis 一般来说对于linux 64位的环境都会有些问题(包找不到) 1. 错误提示信息 2017/11/18 09:54:09 [error] 21876#0: *1 lua entry thread aborted: runtime error: content_by_lua(nginx.conf.compiled:22):2: module 'lap…
lapis 集成openresty最新版本cjson 问题的解决
备注: 为了解决安装了lapis.同时又希望使用新版nginx 以及openresty 的特性(stream ...) 1. 解决方法 参考: https://github.com/leafo/lapis/issues/539 luarocks install lua-cjson2 2. openresty 以及luarocks 最好使用源码安装,可以参考相关文章 3. 测试 lapis new --lua // 修改下nginx.conf 为了集成openresty 的stream…