denim-api-auth-middleware
Advanced tools
Comparing version 1.0.6 to 1.0.7
{ | ||
"name": "denim-api-auth-middleware", | ||
"version": "1.0.6", | ||
"version": "1.0.7", | ||
"description": "Express API Key Auth Middleware", | ||
@@ -8,4 +8,3 @@ "main": "dist/index.js", | ||
"precommit": "lint-staged", | ||
"build": | ||
"rm -rf dist && babel ./ --presets env --out-dir ./dist --source-maps --presets env --ignore node_modules,*.spec.js", | ||
"build": "rm -rf dist && babel ./ --presets env --out-dir ./dist --source-maps --presets env --ignore node_modules,*.spec.js", | ||
"test": "jest", | ||
@@ -18,3 +17,8 @@ "format": "prettier-standard '**/*.js'" | ||
}, | ||
"keywords": ["express", "api", "auth", "middleware"], | ||
"keywords": [ | ||
"express", | ||
"api", | ||
"auth", | ||
"middleware" | ||
], | ||
"author": "Michael W. Clark", | ||
@@ -35,5 +39,10 @@ "license": "MIT", | ||
"lint-staged": { | ||
"*.js": ["prettier-standard **/*.js*", "git add"] | ||
"*.js": [ | ||
"prettier-standard **/*.js*", | ||
"git add" | ||
] | ||
}, | ||
"pre-commit": ["precommit"], | ||
"pre-commit": [ | ||
"precommit" | ||
], | ||
"dependencies": { | ||
@@ -40,0 +49,0 @@ "chai": "^4.1.2" |
@@ -28,2 +28,3 @@ # denim-api-auth-middleware | ||
import makeApiKeyAuthMiddlware from 'denim-api-auth-middleware' | ||
import http from 'http' | ||
@@ -38,5 +39,24 @@ const app = new Express() | ||
app.use(apiKeyAuthMiddlware) // API Key auth middleware | ||
app.get('/',(req, res)=>{ | ||
res.send('Great Success') | ||
}) | ||
const server = http.createServer(app) | ||
server.listen(8080, () => | ||
console.log('HTTP Server Listening on Port',8080) | ||
) | ||
``` | ||
``` | ||
# curl localhost:8080 | ||
Forbidden | ||
# curl localhost:8080 \ | ||
--header "Authorization: mySecretKey:mySecretPassword" | ||
Great Success | ||
``` | ||
## Running the tests | ||
@@ -43,0 +63,0 @@ run tests once: |
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
9783
96