{"id":27148787,"url":"https://github.com/delicatejs/delicatejs","last_synced_at":"2026-05-05T23:32:14.745Z","repository":{"id":57211850,"uuid":"131604457","full_name":"delicatejs/delicatejs","owner":"delicatejs","description":"👜一款基于koa、开箱即用的轻量级后端框架","archived":false,"fork":false,"pushed_at":"2018-10-30T03:11:57.000Z","size":131,"stargazers_count":0,"open_issues_count":1,"forks_count":1,"subscribers_count":0,"default_branch":"master","last_synced_at":"2025-09-20T23:24:56.658Z","etag":null,"topics":["backend","koa2","mvc","node","nodejs","web","webserver"],"latest_commit_sha":null,"homepage":"http://www.sunyangjie.com/2018/04/29/nodejs%E7%89%88web%E4%B8%9A%E5%8A%A1%E5%B1%82%E6%A1%86%E6%9E%B6/","language":"TypeScript","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/delicatejs.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":"2018-04-30T14:16:29.000Z","updated_at":"2018-10-30T03:11:58.000Z","dependencies_parsed_at":"2022-08-30T15:00:15.298Z","dependency_job_id":null,"html_url":"https://github.com/delicatejs/delicatejs","commit_stats":null,"previous_names":["delicatejs/delicate"],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/delicatejs/delicatejs","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/delicatejs%2Fdelicatejs","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/delicatejs%2Fdelicatejs/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/delicatejs%2Fdelicatejs/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/delicatejs%2Fdelicatejs/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/delicatejs","download_url":"https://codeload.github.com/delicatejs/delicatejs/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/delicatejs%2Fdelicatejs/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32672605,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-05T11:29:49.557Z","status":"ssl_error","status_checked_at":"2026-05-05T11:29:48.587Z","response_time":54,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":["backend","koa2","mvc","node","nodejs","web","webserver"],"created_at":"2025-04-08T12:24:19.015Z","updated_at":"2026-05-05T23:32:14.725Z","avatar_url":"https://github.com/delicatejs.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# [DelicateJS](http://www.sunyangjie.com/2018/04/29/nodejs%E7%89%88web%E4%B8%9A%E5%8A%A1%E5%B1%82%E6%A1%86%E6%9E%B6/)\u0026middot; [![GitHub license](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/delicatejs/delicatejs/blob/master/LICENSE) [![NPM version](https://img.shields.io/npm/v/delicate.svg)](https://www.npmjs.com/package/delicate)\n\n一套基于`koa`的轻量级`mvc`框架，旨在让基于 node 的 Web`接口`开发变得更便捷，更灵活，更高效\n\n💀 **注意**\n\n- 不推荐使用该框架进行服务端模板渲染，如果实在要实现服务端渲染，推荐基于 react 的同构框架[next.js](https://github.com/zeit/next.js)\n\n- 该框架注重于基于 api 的后端业务，取消了内置的模板引擎，专注于后端业务层，即`Model和Controller`,弱化了`View`\n\n- 目前框架处于调整期，已经加入 socket 功能\n\n- 整体设计思路参考[CodeIgniter](https://github.com/bcit-ci/CodeIgniter)\n\n### Setup\n\n```\n$ cd example\n$ node index.js\n```\n\n访问 `http://localhost:3001/` [more\u003e](https://github.com/delicatejs)\n\n### Deployment\n\n使用 [pm2](https://github.com/Unitech/pm2) 进行项目的部署服务\n\n### 更新日志\n\n- 服务端返回形式\n\n  - 正常返回\n\n  ```js\n  //例如返回json格式的数据\n  this.ctx.set('Content-Type', 'text/json');\n  this.ctx.body = {};\n  ```\n\n  - 模板返回\n\n  ```js\n  //指定模板的路径和模板需要渲染的数据[数组]\n  this.view(templatePath, templateData);\n  ```\n\n  - 重定向\n\n  ```js\n  //重定向到路由为'/'的页面\n  this.redirect('/');\n  ```\n\n* 请求方式检测\n\n```js\n//core  MY_Controller\nmodule.exports = class extends DJ_Controller {\n  constructor(ctx) {\n    super(ctx);\n    this.MethodNotAllowed(() =\u003e {\n      this.ctx.status = 405;\n      this.ctx.body = 'Method Not Allowed';\n    });\n  }\n};\n\n//controllers\n//目前支持请求方式 'get', 'post', 'delete', 'head', 'options', 'put', 'patch'\nmodule.exports = class extends MY_Controller {\n  async delete() {\n    /*\n     * 指定当前接受的请求方式\n     * 如果请求方式不是delete，会执行this.MethodNotAllowed的回调方法\n     * 如果不指定method，也可以直接写业务，但是这个会任何请求方式都会命中该路由  \n     */\n\n    //指定单个请求方式\n    await this.method.delete();\n\n    //指定多个请求方式\n    await this.method('delete', 'post');\n\n    //指定不同的请求方式的业务代码\n    //必须要先指定所有可能的请求方式\n    //await this.method('post', 'delete')\n    this.method.post(async () =\u003e {\n      //post请求方式的业务代码\n    });\n\n    this.method.delete(async () =\u003e {\n      //delete请求方式的业务代码\n    });\n\n    //编写业务代码\n    //更多查看最佳实践delicatejs-example\n  }\n};\n```\n\n### More\n\n更多使用姿势，请参考[example](https://github.com/delicatejs/delicatejs-example)\n\n### License\n\nMIT\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdelicatejs%2Fdelicatejs","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdelicatejs%2Fdelicatejs","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdelicatejs%2Fdelicatejs/lists"}