{"id":21558354,"url":"https://github.com/doublespout/restspout","last_synced_at":"2026-07-19T16:32:46.835Z","repository":{"id":2135265,"uuid":"3078793","full_name":"DoubleSpout/RestSpout","owner":"DoubleSpout","description":"Restful node.js web framework","archived":false,"fork":false,"pushed_at":"2012-01-05T08:31:03.000Z","size":308,"stargazers_count":5,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-09-24T01:48:42.610Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"http://snoopyxdy.blog.163.com","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/DoubleSpout.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}},"created_at":"2011-12-31T08:20:30.000Z","updated_at":"2016-09-01T02:55:20.000Z","dependencies_parsed_at":"2022-08-06T12:00:59.625Z","dependency_job_id":null,"html_url":"https://github.com/DoubleSpout/RestSpout","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/DoubleSpout/RestSpout","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DoubleSpout%2FRestSpout","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DoubleSpout%2FRestSpout/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DoubleSpout%2FRestSpout/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DoubleSpout%2FRestSpout/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/DoubleSpout","download_url":"https://codeload.github.com/DoubleSpout/RestSpout/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DoubleSpout%2FRestSpout/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":35659409,"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-19T02:00:06.923Z","response_time":112,"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":"2024-11-24T08:14:37.416Z","updated_at":"2026-07-19T16:32:46.789Z","avatar_url":"https://github.com/DoubleSpout.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# RestSpout —— node.js restful ROA web framework\n\n##例子：(simple example)\n\n    var http = require('http'),\n\n\tRestSpout = require('../lib/RestSpout'),//do nothing but only require it!\n\n    server = http.createServer(function (req, res) {\n\n\t\tres.write('\u003cbody\u003e');\n\n\t\tres.write('req.path:'+req.path+'\u003cbr /\u003e');\n\n\t\tres.write('req.ip:'+req.ip+'\u003cbr /\u003e');\n\n\t\tres.write('req.referer or req.referrer:'+req.referer+'\u003cbr /\u003e');\n\n\t\tres.write('req.UserAgent:'+req.UserAgent+'\u003cbr /\u003e');\n\n\t\tres.write('req.GetParam:'+JSON.stringify(req.GetParam)+'\u003cbr /\u003e');\t\n\n\t\tres.write('req.cookie:'+JSON.stringify(req.cookie)+'\u003cbr /\u003e');\n\n\t\tres.end('\u003c/body\u003e');\n\n\t}).listen(3000);\n     \n     一切都和原来一样，只是在入口文件处引入 RestSpout = require('../lib/RestSpout')这个即可，您将方便许多！\n\n## 接口：(API)\n\n req:\n\n 属性：(property)\n\n 1、path：一个数组，拆分了'/'分割的uri\n \n 2、ip：客户端ip字符串\n\n 3、referer（referer+）：访问来源\n\n 4、UserAgent：客户端信息\n \n 5、GetParam：用户GET请求过来的参数\n\n 6、PostParam：用户POST请求过来的参数，具体用法请参与expamle中的ResPost.js\n\n 7、cookie：cookie对象key-value\n\n方法：(method)\n\n1、GetPost(callback)：获取Post数据完毕时调用callback，具体用法请参与expamle中的ResPost.js\n\n2、GetMultiPost([filedir], [callback])：文件上传成功以后调用callback，filedir表示文件存放目录\n\n## 提示：(Tips)\n\n完美兼容expressjs，只需要在入口文件引入 RestSpout = require('../lib/RestSpout'); 然后就可以正常使用expressjs了，想要利用expressjs开发 Restful 架构，只需要：\n\napp.all(/\\S/, function(req, res, next){\n\n\t//your application code\n\n})\n\n这样就可以根据req.path来自定义规则加载指定模块和执行方法了，不用写多个app.get(/路由正则匹配/, function(){})，整合了文件上传的模块，方便管理简单的文件上传\n\n当然如果你完全可以单独引入 RestSpout = require('../lib/RestSpout')，做一些简单的接口应用开发\n\n##展望：(Future)\n\n将来 RestSpout 将开发respose部分，提供比expressjs更友好的API。","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdoublespout%2Frestspout","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdoublespout%2Frestspout","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdoublespout%2Frestspout/lists"}