{"id":31769268,"url":"https://github.com/second-state/serverless-reactor-starter","last_synced_at":"2025-10-10T02:42:43.168Z","repository":{"id":50307857,"uuid":"361834066","full_name":"second-state/serverless-reactor-starter","owner":"second-state","description":null,"archived":false,"fork":false,"pushed_at":"2021-08-29T22:22:59.000Z","size":19187,"stargazers_count":15,"open_issues_count":1,"forks_count":11,"subscribers_count":4,"default_branch":"main","last_synced_at":"2025-05-07T18:57:34.518Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Rust","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/second-state.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":"2021-04-26T17:19:55.000Z","updated_at":"2023-11-13T04:02:22.000Z","dependencies_parsed_at":"2022-09-05T16:40:37.537Z","dependency_job_id":null,"html_url":"https://github.com/second-state/serverless-reactor-starter","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/second-state/serverless-reactor-starter","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/second-state%2Fserverless-reactor-starter","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/second-state%2Fserverless-reactor-starter/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/second-state%2Fserverless-reactor-starter/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/second-state%2Fserverless-reactor-starter/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/second-state","download_url":"https://codeload.github.com/second-state/serverless-reactor-starter/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/second-state%2Fserverless-reactor-starter/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":279002560,"owners_count":26083403,"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","status":"online","status_checked_at":"2025-10-10T02:00:06.843Z","response_time":62,"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":[],"created_at":"2025-10-10T02:42:37.776Z","updated_at":"2025-10-10T02:42:43.161Z","avatar_url":"https://github.com/second-state.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"Serverless Reactors 让你可以快速零成本地构建发布飞书机器人。\n\n# 安装必要的软件\n\n请确保您已经安装了[Rust](https://www.rust-lang.org/tools/install), 和[rustwasmc](https://www.secondstate.io/articles/rustwasmc/).\n为了您的方便，下面是 Linux / Mac / PowerShell 的安装命令。\n\n```src\n$ curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh\n$ source $HOME/.cargo/env\n$ rustup override set 1.50.0\n\n$ curl https://raw.githubusercontent.com/second-state/rustwasmc/master/installer/init.sh -sSf | sh\n```\n\n# 编写机器人逻辑\n\n\u003ca href=\"https://github.com/second-state/serverless-reactor-starter/fork\"\u003e请 fork 这个代码仓库\u003c/a\u003e。默认的函数是一个计算器机器人，向它发一个“2+2”的消息，它就会回答“4”。\n\n```rust\nuse wasm_bindgen::prelude::*;\nuse meval;\n\n#[wasm_bindgen]\npub fn text_received(msg: String, _username: String, _step_data: String) -\u003e String {\n  let x = meval::eval_str(\u0026msg).unwrap();\n  return format!(\"{}\", x);\n}\n```\n\n改动 \u003ca href=\"src/lib.rs\"\u003esrc/lib.rs\u003c/a\u003e 这个文件，将它改为你的机器人逻辑。具体函数的写法请\u003ca href=\"http://reactor.secondstate.info/docs/ch01-00-wasm-functions.html\"\u003e参见文档\u003c/a\u003e。\n\n# 编译\n\n将机器人的函数编译成可以部署的 WebAssembly 文件。\n\n```src\n$ rustwasmc build\n```\n\n# 部署\n\n\u003ca href=\"http://reactor.secondstate.info/docs/user-create-a-bot.html\"\u003e参见文档\u003c/a\u003e创建一个飞书企业应用与 \u003ca href=\"http://reactor.secondstate.info/\"\u003eServerless Reactor\u003c/a\u003e 的对应 app，将编译成功的 `pkg/calculator_lib_bg.wasm` 文件上传到 Serverless Reactor，并把生成的 service URL 提交给飞书。\n\n祝贺你！你现在有了一个属于你的飞书机器人！\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsecond-state%2Fserverless-reactor-starter","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsecond-state%2Fserverless-reactor-starter","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsecond-state%2Fserverless-reactor-starter/lists"}