{"id":51647298,"url":"https://github.com/azzgo/cgi-web-quickstart","last_synced_at":"2026-07-14T00:31:00.448Z","repository":{"id":368020138,"uuid":"1123087760","full_name":"azzgo/cgi-web-quickstart","owner":"azzgo","description":"Personal Use, For Quick Proof of Concetp","archived":false,"fork":false,"pushed_at":"2025-12-26T08:17:47.000Z","size":19,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-06-28T18:29:43.595Z","etag":null,"topics":["cgi-server","skeleton"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","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/azzgo.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,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-12-26T06:52:40.000Z","updated_at":"2025-12-31T03:33:12.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/azzgo/cgi-web-quickstart","commit_stats":null,"previous_names":["azzgo/cgi-web-quickstart"],"tags_count":null,"template":false,"template_full_name":null,"purl":"pkg:github/azzgo/cgi-web-quickstart","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/azzgo%2Fcgi-web-quickstart","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/azzgo%2Fcgi-web-quickstart/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/azzgo%2Fcgi-web-quickstart/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/azzgo%2Fcgi-web-quickstart/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/azzgo","download_url":"https://codeload.github.com/azzgo/cgi-web-quickstart/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/azzgo%2Fcgi-web-quickstart/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":35441637,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-07-13T02:00:06.543Z","response_time":119,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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":["cgi-server","skeleton"],"created_at":"2026-07-14T00:30:59.705Z","updated_at":"2026-07-14T00:31:00.441Z","avatar_url":"https://github.com/azzgo.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# CGI Quick Start\n\n轻量级POC和工具开发脚手架，基于 CGI + Shell Script + JavaScript。\n\n## 快速开始\n\n```bash\n./run.sh\n```\n\n服务器在 http://127.0.0.1:8080 启动。\n\n## 项目结构\n\n```\ncgi-bin/          # 后端 CGI 脚本\n  main.cgi        # 路由入口\n  config.sh       # 配置管理\n  utils.sh        # 工具函数\n  modules/        # 业务模块\nweb/              # 前端资源\nindex.html        # 入口页面\n.env              # 配置文件\nrun.sh           # 启动脚本\n```\n\n## 添加功能模块\n\n1. 在 `cgi-bin/modules/` 创建新的 `.sh` 文件\n2. 实现 `handle_request()` 函数\n3. 在前端 `operations.js` 注册对应操作\n\n### 模块示例\n\n```bash\n#!/bin/bash\nhandle_request() {\n    local request_body=\"$1\"\n    local operation=$(parse_json \"$request_body\" \"operation\")\n\n    case \"$operation\" in\n        \"test\") json_success \"测试成功\" ;;\n        *) json_error \"未知操作\" ;;\n    esac\n}\n```\n\n## API 工具函数\n\n```bash\n# JSON 处理\nparse_json \"$json\" \"key\"\njson_success \"$message\" \"$data\"\njson_error \"$message\"\n\n# 安全验证\nvalidate_input \"$input\" $max_len\nsafe_path \"$path\"\n\n# 日志记录\nlog_info \"$message\"\nlog_error \"$message\"\n```\n\n## Web 端调用\n\n```javascript\napi\n  .call(\"example\", {\n    operation: \"hello\",\n    name: \"world\",\n  })\n  .then((result) =\u003e {\n    console.log(\"return response is: \", result);\n  });\n```\n\n## 配置 (.env)\n\n```bash\nPORT=8080\nHOST=127.0.0.1\nDEBUG=true\nAPP_NAME=\"CGI Quick Start\"\n```\n\n## 常见问题\n\n- 权限问题：`chmod +x cgi-bin/*.cgi cgi-bin/modules/*.sh`\n- 端口占用：`./run.sh -p 3000`\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fazzgo%2Fcgi-web-quickstart","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fazzgo%2Fcgi-web-quickstart","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fazzgo%2Fcgi-web-quickstart/lists"}