Comparing version 4.5.0 to 5.0.0
@@ -32,3 +32,2 @@ | ||
groups () { | ||
console.log('abc') | ||
return {count: 2, data: [{userId: 'userId'}]} | ||
@@ -51,7 +50,4 @@ }, | ||
const restful = (logger, router) => { | ||
router.use('/hello', (req, res) => res.end('world')) | ||
} | ||
const unrestrict = (logger, router) => { | ||
const restful = (logger, router, restrict) => { | ||
router.use('/hello', restrict(), (req, res) => res.end('world')) | ||
router.use('/999', (req, res) => res.end('666')) | ||
@@ -77,4 +73,3 @@ } | ||
restful, | ||
unrestrict, | ||
io, | ||
}) |
10
index.js
@@ -61,4 +61,4 @@ | ||
const rapi = require('express').Router() | ||
options.restful(logger, rapi) | ||
app.use('/api', restrict(), rapi) | ||
options.restful(logger, rapi, restrict) | ||
app.use('/', rapi) | ||
} | ||
@@ -70,8 +70,2 @@ | ||
if (options.unrestrict) { | ||
const rapi = require('express').Router() | ||
options.unrestrict(logger, rapi) | ||
app.use('/', rapi) | ||
} | ||
app.use(error) | ||
@@ -78,0 +72,0 @@ |
{ | ||
"name": "ers-http", | ||
"version": "4.5.0", | ||
"version": "5.0.0", | ||
"description": "", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
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
7168
191