{"id":27118437,"url":"https://github.com/suconghou/nodeserve","last_synced_at":"2025-04-07T07:58:02.660Z","repository":{"id":70470992,"uuid":"198610269","full_name":"suconghou/nodeserve","owner":"suconghou","description":null,"archived":false,"fork":false,"pushed_at":"2023-10-11T03:23:48.000Z","size":29,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2023-10-11T08:31:21.464Z","etag":null,"topics":["http","nodejs","typescript"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","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/suconghou.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}},"created_at":"2019-07-24T10:11:03.000Z","updated_at":"2021-11-17T02:36:42.000Z","dependencies_parsed_at":"2023-05-15T14:00:24.135Z","dependency_job_id":null,"html_url":"https://github.com/suconghou/nodeserve","commit_stats":null,"previous_names":[],"tags_count":0,"template":null,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/suconghou%2Fnodeserve","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/suconghou%2Fnodeserve/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/suconghou%2Fnodeserve/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/suconghou%2Fnodeserve/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/suconghou","download_url":"https://codeload.github.com/suconghou/nodeserve/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247615474,"owners_count":20967183,"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":["http","nodejs","typescript"],"created_at":"2025-04-07T07:58:01.795Z","updated_at":"2025-04-07T07:58:02.642Z","avatar_url":"https://github.com/suconghou.png","language":"TypeScript","readme":"## nodeserve\n\ntypescript nodejs http framework\n\n执行流程:\n\n\n中间件 --\u003e 路由 --\u003e 静态文件 --\u003e after钩子\n\n`中间件 --\u003e 路由 --\u003e 静态文件` 过程,任意一个过程返回false,即中断后续执行\n\n`after钩子`必然会执行,此钩子检查当前请求生成的中间件执行栈\n\n依次执行,每个中间件可配置使用继续执行(next),还是中断(stop);默认不选择时将会等待超时然后stop\n\n\n\n\n\n中间件 --\u003e 决定路由配置,动态路由\n中间件 --\u003e 决定静态文件配置\n\n\n中间件是多匹配模式\n\n路由是但匹配模式\n\n路由超时时间\n\n路由执行过后若未end则,执行静态文件\n\n中间件的权限非常大,可遍历整个路由,增删查改\n\n\n\n中间件有两种流程控制\n\nnext,stop\n\n\n\n框架提供的req\n\n属性\n\nreq.path\n\nreq.query\n\nreq.ctx\n\n当前路由信息\n\nparams 匹配到的路由参数\n\nrun\n\nmiddlewares\n\nroutes\n\n\n\n方法\n\nasync req.body\n\nasync req.json\n\nreq.after\n\n\n\n框架提供的res\n\n\n方法\n\nasync json\n\n响应json数据\n\nasync file\n\n响应文件\n\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsuconghou%2Fnodeserve","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsuconghou%2Fnodeserve","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsuconghou%2Fnodeserve/lists"}