liusheng6982 / lsp Goto Github PK
View Code? Open in Web Editor NEWlua server page
lua server page
1、在ngx_lua的基础上,仿照jsp的标签方式,用lua实现的lsp( lua server page ) 2、只实现了三个标签:<%= %> <% %> <%include file=""%> 3、这个三个标签只简单的测试过,对标签中的出现的各种异常关未覆盖到。 4、urlconf是主入口,请按原来的例子配置 5、lsp文件按jsp的方式,会生成一lua文件,此版本如果lsp就有修改,不会自动更新lua文件,需要手工册work下对应的lua文件 6、对url的配置,参照Django,学其皮毛,形似 使用方法: 1、先ngx_lua安装,下载openresty,我的安装路/opt/openresty/; 2、把整个项目复制到/opt/openresty/nginx/conf/lua/下,目录结构如下 lua ├─biz #业务处理放的路径,不限定此文件夹名称,在urlconf中定义 ├─lsp #存放页面的地方,不限定此文件夹名称,在urlconf中定义 │ ├─blog │ └─sample ├─lsplib #源代码 └─work #根据lsp生成的 lua文件,此文件名限定死,work文件夹权限需要777 ├─blog └─sample 3、修改在/opt/openresty/nginx/conf/nginx.conf文件(详见代码中的nginx.conf文件),添加如下: env LSP_HOME=/opt/openresty/nginx/conf/lua; 修改 lua_package_path '/opt/openresty/nginx/conf/lua/?.lua;;'; 加server中加下如下: location ~ ^/lua/(\w+) { default_type 'text/html'; content_by_lua_file conf/lua/urlconf.lua; lua_code_cache off; }
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.