{"id":16853681,"url":"https://github.com/abersheeran/aligi","last_synced_at":"2025-04-11T07:12:47.343Z","repository":{"id":57409738,"uuid":"201511532","full_name":"abersheeran/aligi","owner":"abersheeran","description":"为阿里无服务函数提供API网关的协议解析","archived":false,"fork":false,"pushed_at":"2020-08-15T20:56:21.000Z","size":31,"stargazers_count":4,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-04-11T07:12:38.531Z","etag":null,"topics":["wsgi"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/abersheeran.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2019-08-09T17:17:59.000Z","updated_at":"2020-10-12T12:58:05.000Z","dependencies_parsed_at":"2022-08-24T18:50:59.033Z","dependency_job_id":null,"html_url":"https://github.com/abersheeran/aligi","commit_stats":null,"previous_names":[],"tags_count":7,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/abersheeran%2Faligi","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/abersheeran%2Faligi/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/abersheeran%2Faligi/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/abersheeran%2Faligi/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/abersheeran","download_url":"https://codeload.github.com/abersheeran/aligi/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248358603,"owners_count":21090405,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":["wsgi"],"created_at":"2024-10-13T13:52:52.913Z","updated_at":"2025-04-11T07:12:47.307Z","avatar_url":"https://github.com/abersheeran.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# aligi\n\nAliyun Gateway Interface\n\n为无服务函数计算作为阿里云 API 后端运行提供转析，并且允许同一个无服务函数既支持 HTTP 触发器，也支持作为 API 网关的后端服务。\n\n## 为什么会有这个库？\n\n使用 Flask，Django 等支持标准 WSGI 协议的 Web 框架创建无服务函数时，使用HTTP触发器才能让它们正常运行。\n\n但如果想使用无服务函数作为阿里云 API 网关的后端时，则无法直接使用这些函数，只能通过网络调用，这显然是不够高效、并且费钱的。\n\n## 如何安装\n\n在项目根目录下执行\n\n```\npip install -t . aligi\n```\n\n## 如何使用\n\n以下为一个最小的 Flask 样例\n\n```python\nfrom flask import Flask\nfrom aligi import WSGI\n\napp = Flask(__name__)\n\n\n@app.route(\"/\")\ndef hello_world():\n    return \"Hello, World!\"\n\n\n# 阿里云无服务函数的入口\nhandler = WSGI(app)\n```\n\n其中`app`可以是任意一个标准 WSGI Application。\n\n在 Django 项目中，它一般在项目的`wsgi.py`里。\n\n## 参考文档\n\n阿里云文档:\n\n- [HTTP 触发器](https://help.aliyun.com/document_detail/74756.html?spm=a2c4g.11186623.2.29.4a4b6482rl6rYZ#h2--http-2)\n\n- [API 网关触发器](https://help.aliyun.com/document_detail/74800.html?spm=a2c4g.11186623.6.696.24bd2ebcuaTlC2)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fabersheeran%2Faligi","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fabersheeran%2Faligi","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fabersheeran%2Faligi/lists"}