├── .autod.conf.js ├── .eslintignore ├── .eslintrc ├── .github └── PULL_REQUEST_TEMPLATE.md ├── .gitignore ├── .travis.yml ├── History.md ├── README.md ├── app.js ├── app └── middleware │ └── rest.js ├── appveyor.yml ├── config └── config.default.js ├── lib ├── api.js └── load_api.js ├── package.json └── test ├── fixtures ├── rest-error │ ├── app │ │ └── api │ │ │ └── users.js │ ├── config │ │ ├── config.default.js │ │ └── plugin.js │ └── package.json ├── rest-typeerror │ ├── app │ │ └── middlewares │ │ │ └── rest.js │ ├── config │ │ ├── config.default.js │ │ └── plugin.js │ └── package.json ├── rest-with-apis │ ├── app │ │ └── apis │ │ │ ├── categories.js │ │ │ ├── posts.js │ │ │ ├── posts │ │ │ └── replies.js │ │ │ ├── sites │ │ │ ├── channels.js │ │ │ └── index.js │ │ │ ├── typescripts.js │ │ │ ├── users.js │ │ │ └── users │ │ │ ├── posts.js │ │ │ └── posts │ │ │ ├── replies.js │ │ │ └── replies │ │ │ └── answer.js │ ├── config │ │ ├── config.default.js │ │ ├── config.unittest.js │ │ └── plugin.js │ └── package.json ├── rest-with-auth │ ├── app │ │ └── api │ │ │ └── users.js │ ├── config │ │ ├── config.default.js │ │ ├── config.unittest.js │ │ └── plugin.js │ └── package.json └── rest │ ├── app │ └── api │ │ ├── categories.js │ │ ├── posts.js │ │ ├── posts │ │ └── replies.js │ │ ├── sites │ │ ├── channels.js │ │ └── index.js │ │ ├── typescripts.js │ │ ├── users.js │ │ └── users │ │ ├── posts.js │ │ └── posts │ │ ├── replies.js │ │ └── replies │ │ └── answer.js │ ├── config │ ├── config.default.js │ ├── config.unittest.js │ └── plugin.js │ └── package.json └── rest.test.js /.autod.conf.js: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eggjs/egg-rest/HEAD/.autod.conf.js -------------------------------------------------------------------------------- /.eslintignore: -------------------------------------------------------------------------------- 1 | coverage -------------------------------------------------------------------------------- /.eslintrc: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "eslint-config-egg" 3 | } 4 | -------------------------------------------------------------------------------- /.github/PULL_REQUEST_TEMPLATE.md: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eggjs/egg-rest/HEAD/.github/PULL_REQUEST_TEMPLATE.md -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | node_modules 2 | coverage 3 | *logs 4 | *run 5 | .idea/ 6 | -------------------------------------------------------------------------------- /.travis.yml: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eggjs/egg-rest/HEAD/.travis.yml -------------------------------------------------------------------------------- /History.md: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eggjs/egg-rest/HEAD/History.md -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eggjs/egg-rest/HEAD/README.md -------------------------------------------------------------------------------- /app.js: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eggjs/egg-rest/HEAD/app.js -------------------------------------------------------------------------------- /app/middleware/rest.js: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eggjs/egg-rest/HEAD/app/middleware/rest.js -------------------------------------------------------------------------------- /appveyor.yml: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eggjs/egg-rest/HEAD/appveyor.yml -------------------------------------------------------------------------------- /config/config.default.js: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eggjs/egg-rest/HEAD/config/config.default.js -------------------------------------------------------------------------------- /lib/api.js: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eggjs/egg-rest/HEAD/lib/api.js -------------------------------------------------------------------------------- /lib/load_api.js: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eggjs/egg-rest/HEAD/lib/load_api.js -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eggjs/egg-rest/HEAD/package.json -------------------------------------------------------------------------------- /test/fixtures/rest-error/app/api/users.js: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eggjs/egg-rest/HEAD/test/fixtures/rest-error/app/api/users.js -------------------------------------------------------------------------------- /test/fixtures/rest-error/config/config.default.js: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eggjs/egg-rest/HEAD/test/fixtures/rest-error/config/config.default.js -------------------------------------------------------------------------------- /test/fixtures/rest-error/config/plugin.js: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eggjs/egg-rest/HEAD/test/fixtures/rest-error/config/plugin.js -------------------------------------------------------------------------------- /test/fixtures/rest-error/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "rest-error" 3 | } 4 | -------------------------------------------------------------------------------- /test/fixtures/rest-typeerror/app/middlewares/rest.js: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eggjs/egg-rest/HEAD/test/fixtures/rest-typeerror/app/middlewares/rest.js -------------------------------------------------------------------------------- /test/fixtures/rest-typeerror/config/config.default.js: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eggjs/egg-rest/HEAD/test/fixtures/rest-typeerror/config/config.default.js -------------------------------------------------------------------------------- /test/fixtures/rest-typeerror/config/plugin.js: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eggjs/egg-rest/HEAD/test/fixtures/rest-typeerror/config/plugin.js -------------------------------------------------------------------------------- /test/fixtures/rest-typeerror/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "rest-typeerror" 3 | } 4 | -------------------------------------------------------------------------------- /test/fixtures/rest-with-apis/app/apis/categories.js: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eggjs/egg-rest/HEAD/test/fixtures/rest-with-apis/app/apis/categories.js -------------------------------------------------------------------------------- /test/fixtures/rest-with-apis/app/apis/posts.js: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eggjs/egg-rest/HEAD/test/fixtures/rest-with-apis/app/apis/posts.js -------------------------------------------------------------------------------- /test/fixtures/rest-with-apis/app/apis/posts/replies.js: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eggjs/egg-rest/HEAD/test/fixtures/rest-with-apis/app/apis/posts/replies.js -------------------------------------------------------------------------------- /test/fixtures/rest-with-apis/app/apis/sites/channels.js: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eggjs/egg-rest/HEAD/test/fixtures/rest-with-apis/app/apis/sites/channels.js -------------------------------------------------------------------------------- /test/fixtures/rest-with-apis/app/apis/sites/index.js: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eggjs/egg-rest/HEAD/test/fixtures/rest-with-apis/app/apis/sites/index.js -------------------------------------------------------------------------------- /test/fixtures/rest-with-apis/app/apis/typescripts.js: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eggjs/egg-rest/HEAD/test/fixtures/rest-with-apis/app/apis/typescripts.js -------------------------------------------------------------------------------- /test/fixtures/rest-with-apis/app/apis/users.js: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eggjs/egg-rest/HEAD/test/fixtures/rest-with-apis/app/apis/users.js -------------------------------------------------------------------------------- /test/fixtures/rest-with-apis/app/apis/users/posts.js: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eggjs/egg-rest/HEAD/test/fixtures/rest-with-apis/app/apis/users/posts.js -------------------------------------------------------------------------------- /test/fixtures/rest-with-apis/app/apis/users/posts/replies.js: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eggjs/egg-rest/HEAD/test/fixtures/rest-with-apis/app/apis/users/posts/replies.js -------------------------------------------------------------------------------- /test/fixtures/rest-with-apis/app/apis/users/posts/replies/answer.js: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eggjs/egg-rest/HEAD/test/fixtures/rest-with-apis/app/apis/users/posts/replies/answer.js -------------------------------------------------------------------------------- /test/fixtures/rest-with-apis/config/config.default.js: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eggjs/egg-rest/HEAD/test/fixtures/rest-with-apis/config/config.default.js -------------------------------------------------------------------------------- /test/fixtures/rest-with-apis/config/config.unittest.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | exports.logger = { 4 | consoleLevel: 'NONE', 5 | }; 6 | -------------------------------------------------------------------------------- /test/fixtures/rest-with-apis/config/plugin.js: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eggjs/egg-rest/HEAD/test/fixtures/rest-with-apis/config/plugin.js -------------------------------------------------------------------------------- /test/fixtures/rest-with-apis/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "rest" 3 | } 4 | -------------------------------------------------------------------------------- /test/fixtures/rest-with-auth/app/api/users.js: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eggjs/egg-rest/HEAD/test/fixtures/rest-with-auth/app/api/users.js -------------------------------------------------------------------------------- /test/fixtures/rest-with-auth/config/config.default.js: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eggjs/egg-rest/HEAD/test/fixtures/rest-with-auth/config/config.default.js -------------------------------------------------------------------------------- /test/fixtures/rest-with-auth/config/config.unittest.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | exports.logger = { 4 | stdoutLevel: 'NONE', 5 | }; 6 | -------------------------------------------------------------------------------- /test/fixtures/rest-with-auth/config/plugin.js: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eggjs/egg-rest/HEAD/test/fixtures/rest-with-auth/config/plugin.js -------------------------------------------------------------------------------- /test/fixtures/rest-with-auth/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "rest-with-auth" 3 | } 4 | -------------------------------------------------------------------------------- /test/fixtures/rest/app/api/categories.js: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eggjs/egg-rest/HEAD/test/fixtures/rest/app/api/categories.js -------------------------------------------------------------------------------- /test/fixtures/rest/app/api/posts.js: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eggjs/egg-rest/HEAD/test/fixtures/rest/app/api/posts.js -------------------------------------------------------------------------------- /test/fixtures/rest/app/api/posts/replies.js: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eggjs/egg-rest/HEAD/test/fixtures/rest/app/api/posts/replies.js -------------------------------------------------------------------------------- /test/fixtures/rest/app/api/sites/channels.js: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eggjs/egg-rest/HEAD/test/fixtures/rest/app/api/sites/channels.js -------------------------------------------------------------------------------- /test/fixtures/rest/app/api/sites/index.js: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eggjs/egg-rest/HEAD/test/fixtures/rest/app/api/sites/index.js -------------------------------------------------------------------------------- /test/fixtures/rest/app/api/typescripts.js: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eggjs/egg-rest/HEAD/test/fixtures/rest/app/api/typescripts.js -------------------------------------------------------------------------------- /test/fixtures/rest/app/api/users.js: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eggjs/egg-rest/HEAD/test/fixtures/rest/app/api/users.js -------------------------------------------------------------------------------- /test/fixtures/rest/app/api/users/posts.js: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eggjs/egg-rest/HEAD/test/fixtures/rest/app/api/users/posts.js -------------------------------------------------------------------------------- /test/fixtures/rest/app/api/users/posts/replies.js: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eggjs/egg-rest/HEAD/test/fixtures/rest/app/api/users/posts/replies.js -------------------------------------------------------------------------------- /test/fixtures/rest/app/api/users/posts/replies/answer.js: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eggjs/egg-rest/HEAD/test/fixtures/rest/app/api/users/posts/replies/answer.js -------------------------------------------------------------------------------- /test/fixtures/rest/config/config.default.js: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eggjs/egg-rest/HEAD/test/fixtures/rest/config/config.default.js -------------------------------------------------------------------------------- /test/fixtures/rest/config/config.unittest.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | exports.logger = { 4 | consoleLevel: 'NONE', 5 | }; 6 | -------------------------------------------------------------------------------- /test/fixtures/rest/config/plugin.js: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eggjs/egg-rest/HEAD/test/fixtures/rest/config/plugin.js -------------------------------------------------------------------------------- /test/fixtures/rest/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "rest" 3 | } 4 | -------------------------------------------------------------------------------- /test/rest.test.js: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eggjs/egg-rest/HEAD/test/rest.test.js --------------------------------------------------------------------------------