-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit 3b68aba
Showing
7 changed files
with
134 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
# editorconfig.org | ||
root = true | ||
|
||
[*] | ||
indent_style = space | ||
indent_size = 2 | ||
end_of_line = lf | ||
charset = utf-8 | ||
trim_trailing_whitespace = true | ||
insert_final_newline = true | ||
|
||
[*.md] | ||
trim_trailing_whitespace = false |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
.DS_Store | ||
Thumbs.db | ||
npm/ | ||
coverage |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
{ | ||
"recommendations": [ | ||
"denoland.vscode-deno" | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
{ | ||
"deno.enable": true, | ||
"deno.lint": true, | ||
"deno.codeLens.test": true, | ||
"editor.defaultFormatter": "denoland.vscode-deno", | ||
"editor.formatOnSave": true, | ||
"editor.codeActionsOnSave": { | ||
"source.fixAll": true | ||
}, | ||
"deno.inlayHints.enumMemberValues.enabled": false, | ||
"deno.inlayHints.functionLikeReturnTypes.enabled": false, | ||
"deno.inlayHints.parameterTypes.enabled": false, | ||
"deno.inlayHints.propertyDeclarationTypes.enabled": false, | ||
"deno.inlayHints.variableTypes.suppressWhenTypeMatchesName": false, | ||
"deno.inlayHints.variableTypes.enabled": false, | ||
"deno.inlayHints.parameterNames.enabled": "none", | ||
"deno.inlayHints.parameterNames.suppressWhenArgumentMatchesName": false | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
MIT License | ||
|
||
Copyright (c) 2023 httpland | ||
|
||
Permission is hereby granted, free of charge, to any person obtaining a copy of | ||
this software and associated documentation files (the "Software"), to deal in | ||
the Software without restriction, including without limitation the rights to | ||
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of | ||
the Software, and to permit persons to whom the Software is furnished to do so, | ||
subject to the following conditions: | ||
|
||
The above copyright notice and this permission notice shall be included in all | ||
copies or substantial portions of the Software. | ||
|
||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS | ||
FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR | ||
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER | ||
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN | ||
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
# http-middleware | ||
|
||
HTTP middleware specification | ||
|
||
## What | ||
|
||
Define standard HTTP middleware specifications. This is intended to increase the | ||
interoperability of the HTTP library's own middleware. | ||
|
||
It consists only of the web standards stack and is compatible with many | ||
Browsers. | ||
|
||
## Interface | ||
|
||
Middleware interfaces can be defined in TypeScript as follows: | ||
|
||
```ts | ||
interface Middleware { | ||
(request: Request, next: Handler): Response | Promise<Response>; | ||
} | ||
|
||
interface Handler { | ||
(request: Request): Response | Promise<Response>; | ||
} | ||
``` | ||
|
||
## Features | ||
|
||
`Middleware` has the following features: | ||
|
||
- Compatible with `Handler`. | ||
|
||
`Handler` is a powerful interface for handling HTTP requests. The `Middleware` | ||
is purely an extension and compatibility with `Handler`. | ||
|
||
- It can access to the `Request`. | ||
- It can access the next handler. | ||
- It can call the next handler. | ||
- It can choose not to call the next handler. | ||
- It can access the next handler's return value (`Response`). | ||
- It can return `Response`. | ||
|
||
## License | ||
|
||
Copyright © 2023-present [httpland](https://github.com/httpland). | ||
|
||
Released under the [MIT](./LICENSE) license |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
{ | ||
"tasks": { | ||
"test": "deno test --doc", | ||
"coverage": "deno coverage", | ||
"build:npm": "deno run -A _tools/build_npm.ts" | ||
}, | ||
"fmt": { | ||
"files": { | ||
"exclude": ["CHANGELOG.md", "CODE_OF_CONDUCT.md"] | ||
} | ||
}, | ||
"lint": { | ||
"files": { | ||
"exclude": ["CHANGELOG.md", "CODE_OF_CONDUCT.md"] | ||
} | ||
}, | ||
"test": { | ||
"files": { | ||
"exclude": ["CHANGELOG.md", "CODE_OF_CONDUCT.md"] | ||
} | ||
}, | ||
"compilerOptions": { | ||
"noImplicitReturns": true, | ||
"noImplicitOverride": true, | ||
"noUncheckedIndexedAccess": true | ||
} | ||
} |