{"id":19779125,"url":"https://github.com/rongfengliang/openresty_luarocksmodule-demo","last_synced_at":"2026-05-16T18:07:59.790Z","repository":{"id":106172963,"uuid":"163912101","full_name":"rongfengliang/openresty_luarocksmodule-demo","owner":"rongfengliang","description":"openresty_ with demo luarocks module demo","archived":false,"fork":false,"pushed_at":"2019-01-04T02:27:41.000Z","size":4,"stargazers_count":2,"open_issues_count":0,"forks_count":1,"subscribers_count":0,"default_branch":"master","last_synced_at":"2025-10-07T19:56:54.581Z","etag":null,"topics":["docker-compose","luarocks","oopenresty"],"latest_commit_sha":null,"homepage":null,"language":"Lua","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/rongfengliang.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2019-01-03T02:15:01.000Z","updated_at":"2022-12-06T09:43:55.000Z","dependencies_parsed_at":"2023-06-15T22:15:48.749Z","dependency_job_id":null,"html_url":"https://github.com/rongfengliang/openresty_luarocksmodule-demo","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/rongfengliang/openresty_luarocksmodule-demo","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rongfengliang%2Fopenresty_luarocksmodule-demo","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rongfengliang%2Fopenresty_luarocksmodule-demo/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rongfengliang%2Fopenresty_luarocksmodule-demo/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rongfengliang%2Fopenresty_luarocksmodule-demo/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/rongfengliang","download_url":"https://codeload.github.com/rongfengliang/openresty_luarocksmodule-demo/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rongfengliang%2Fopenresty_luarocksmodule-demo/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":33113509,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-16T04:41:52.686Z","status":"ssl_error","status_checked_at":"2026-05-16T04:41:52.009Z","response_time":115,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["docker-compose","luarocks","oopenresty"],"created_at":"2024-11-12T05:33:34.941Z","updated_at":"2026-05-16T18:07:59.760Z","avatar_url":"https://github.com/rongfengliang.png","language":"Lua","funding_links":[],"categories":[],"sub_categories":[],"readme":"# openresty with simple luarocks demo\n\n## luarocks packages create\n\n* init spec\n\n```code\nluarocks-5.1 write_rockspec --lua-version=5.1\n\n```\n\n* add some codes\n\n```code\nmkdir -p users\ntouch users/login.lua\n\njust like below:\n\nfunction init(name,password)\n   return name,password\nend\nreturn init;\n\n```\n\n* modify spec file info\n\n```code\nchange name to lua-rocks-app-project-1.0.0-2.rockspec\n\ncontent like below:\n\npackage = \"lua-rocks-app-project\"\nversion = \"1.0.0-2\"\nsource = {\n   url = \"git://github.com/rongfengliang/luarocks-packagedemo.git\"\n}\ndescription = {\n   homepage = \"https://github.com/rongfengliang/luarocks-packagedemo.git\",\n   license = \"unlicense\"\n}\ndependencies = {\n   \"lua ~\u003e 5.1\"\n}\nbuild = {\n   type = \"builtin\",\n   modules = {\n      [\"users.login\"]=\"users/login.lua\"\n   }\n}\n\n```\n\n* publish module\n\n```code\nluarocks upload lua-rocks-app-project-1.0.0-2.rockspec  --api-key=${api-key}\n```\n\n* how to use the package in your project\n\nwith  openresty for test\n\n```code\nmkdir app/app\n\ntouch app/app/init.lua\n\ncontent:\n\nlocal userslogin = require(\"users.login\")\nlocal json = require(\"cjson\")\nfunction  logininfo(name,pass)\n   local name,pass = userslogin(name,pass)\n    local loginresult= {\n        name = name,\n        pass = pass\n    }\n    ngx.say(json.encode(loginresult))\nend\n\nreturn logininfo\n\nopenresty call the module\n\ncontent_by_lua_block {\n             require(\"app/init\")(\"dalong\",\"admin\");\n}\n```\n\n## running project\n\nwith docker \u0026\u0026 docker-compose\n\n* dockerfile\n\nadd luarocks install module\n\n```code\nFROM openresty/openresty:alpine-fat\nLABEL author=\"1141591465@qq.com\"\nRUN /usr/local/openresty/luajit/bin/luarocks install lua-rocks-app-project\n\n```\n\n* build image\n\n```code\ndocker-compose build\n```\n\n* running\n\n```code\ndocker-compose up -d\n```\n\n* watch result\n\n```code\ncurl http://localhost:8080/info\n```","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frongfengliang%2Fopenresty_luarocksmodule-demo","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frongfengliang%2Fopenresty_luarocksmodule-demo","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frongfengliang%2Fopenresty_luarocksmodule-demo/lists"}