源码网商城,靠谱的源码在线交易网站 我的订单 购物车 帮助

源码网商城

基于 aLi Lua Web Server 的一个简单例子

  • 时间:2021-06-24 18:23 编辑: 来源: 阅读:
  • 扫一扫,手机访问
摘要:基于 aLi Lua Web Server 的一个简单例子
[u]复制代码[/u] 代码如下:
file = 'index.lua' if headers.uri ~= '/' then file = headers.uri end   local fexists = file_exists(file)   if not fexists then     -- try stat file.lua     fexists = file_exists(file .. '.lua')     if fexists then         file = file .. '.lua'     end end   if fexists then     if file:find('.css') or file:find('.js') or file:find('font') or file:find('.ico') or file:find('images') then         header('HTTP/1.1 200 OK')         header('Cache-Control: max-age=864000')         sendfile(file)     else         header({'Expires:Thu, 19 Nov 1981 08:52:00 GMT',                 'Pragma:no-cache'})           dofile(file)     end else     header('HTTP/1.1 404 Not Found')     die('File Not Found!') end   die()
以上所述的全部内容了,希望大家能够喜欢。
  • 全部评论(0)
联系客服
客服电话:
400-000-3129
微信版

扫一扫进微信版
返回顶部