koa-architect
Advanced tools
Comparing version 1.0.2 to 1.0.3
{ | ||
"name": "koa-architect", | ||
"version": "1.0.2", | ||
"version": "1.0.3", | ||
"homepage": "https://github.com/nervgh/koa-architect", | ||
@@ -5,0 +5,0 @@ "main": "lib/architect.js", |
@@ -52,18 +52,11 @@ # koa-architect | ||
![img](./screenshot.png) | ||
![example](./screenshot.png) | ||
``` | ||
middleware/ | ||
middleware/01-foo/ | ||
middleware/01-foo/index.js | ||
middleware/02-bar/ | ||
middleware/02-bar/index.js | ||
middleware/route/ | ||
middleware/route/index.js | ||
middleware/nested/ | ||
middleware/nested/index.js | ||
middleware/nested/middleware/ | ||
middleware/nested/middleware/index/ | ||
middleware/nested/middleware/index/index.js | ||
middleware/nested/middleware/baz/ | ||
middleware/nested/middleware/baz/index.js | ||
@@ -73,2 +66,3 @@ ``` | ||
```js | ||
// Middleware | ||
module.exports = function (ctx, next) { | ||
@@ -82,2 +76,3 @@ // Doing here some work and go next | ||
```js | ||
// Middleware | ||
module.exports = function (ctx, next) { | ||
@@ -91,2 +86,3 @@ // Doing here some work and go next | ||
```js | ||
// Routes | ||
exports.get = { | ||
@@ -106,2 +102,4 @@ 'index': function (ctx) { | ||
```js | ||
// Nested middleware and/or routes | ||
const path = require('path') | ||
@@ -117,2 +115,3 @@ const architect = require('koa-architect') | ||
```js | ||
// Routes | ||
exports.use = function (ctx) { | ||
@@ -124,2 +123,3 @@ ctx.response.body = ctx.originalUrl | ||
```js | ||
// Routes | ||
exports.get = { | ||
@@ -126,0 +126,0 @@ 'index': function (ctx) { |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
7608