From 54ceed5a31f982aab231c3f7072f9f3beeebc488 Mon Sep 17 00:00:00 2001 From: Craig Morten <46491566+asos-craigmorten@users.noreply.github.com> Date: Mon, 25 May 2020 10:13:43 +0100 Subject: [PATCH] [NO-ISSUE] fix for v1.0.2 (#2) * feat: fix for v1.0.1 and v1.0.2 * feat: drop support for Deno v1.0.1 * chore: small gh-pages update * feat: make mention of versions in the README * feat: boyscout further readme instructions on installing Opine versions and running examples * feat: tighten permissions in example instructions and add READMEs --- .github/CHANGELOG.md | 8 + .github/workflows/test.yml | 2 +- README.md | 56 +++-- deps.ts | 2 +- docs/_config.yaml | 2 + docs/classes/_response_.response.html | 50 ++--- docs/index.html | 2 +- docs/interfaces/_types_.application.html | 110 +++++----- docs/interfaces/_types_.byterange.html | 4 +- docs/interfaces/_types_.handler.html | 2 +- docs/interfaces/_types_.iroute.html | 54 ++--- docs/interfaces/_types_.irouter.html | 62 +++--- docs/interfaces/_types_.irouterhandler.html | 4 +- docs/interfaces/_types_.iroutermatcher.html | 6 +- docs/interfaces/_types_.mediatype.html | 8 +- docs/interfaces/_types_.nextfunction.html | 4 +- docs/interfaces/_types_.opine.html | 114 +++++----- docs/interfaces/_types_.request.html | 24 +-- docs/interfaces/_types_.requesthandler.html | 2 +- docs/interfaces/_types_.response.html | 48 ++--- docs/interfaces/_types_.router.html | 62 +++--- docs/modules/_application_.html | 8 +- docs/modules/_methods_.html | 2 +- .../_middleware_bodyparser_getcharset_.html | 2 +- .../_middleware_bodyparser_hasbody_.html | 2 +- .../modules/_middleware_bodyparser_json_.html | 10 +- docs/modules/_middleware_bodyparser_raw_.html | 2 +- .../modules/_middleware_bodyparser_read_.html | 6 +- .../modules/_middleware_bodyparser_text_.html | 2 +- .../_middleware_bodyparser_typechecker_.html | 6 +- .../_middleware_bodyparser_urlencoded_.html | 2 +- docs/modules/_middleware_init_.html | 6 +- docs/modules/_middleware_query_.html | 2 +- docs/modules/_opine_.html | 4 +- docs/modules/_request_.html | 2 +- docs/modules/_router_index_.html | 22 +- docs/modules/_router_layer_.html | 4 +- docs/modules/_router_route_.html | 2 +- docs/modules/_types_.html | 24 +-- docs/modules/_utils_compileetag_.html | 8 +- docs/modules/_utils_contentdisposition_.html | 2 +- docs/modules/_utils_definegetter_.html | 2 +- docs/modules/_utils_encodeurl_.html | 8 +- docs/modules/_utils_escapehtml_.html | 4 +- docs/modules/_utils_etag_.html | 10 +- docs/modules/_utils_finalhandler_.html | 22 +- docs/modules/_utils_fresh_.html | 8 +- docs/modules/_utils_merge_.html | 2 +- docs/modules/_utils_mergedescriptors_.html | 4 +- docs/modules/_utils_pathtoregex_.html | 10 +- docs/modules/_utils_stringify_.html | 2 +- docs/modules/_utils_url_.html | 6 +- examples/downloads/README.md | 15 ++ examples/downloads/index.ts | 17 ++ examples/error/README.md | 15 ++ examples/error/index.ts | 16 ++ examples/hello-world/README.md | 15 ++ examples/hello-world/index.ts | 13 ++ examples/multi-router/README.md | 15 ++ examples/multi-router/index.ts | 13 ++ lock.json | 204 +++++++++--------- mod.ts | 2 +- version.ts | 4 +- 63 files changed, 654 insertions(+), 497 deletions(-) create mode 100644 examples/downloads/README.md create mode 100644 examples/error/README.md create mode 100644 examples/hello-world/README.md create mode 100644 examples/multi-router/README.md diff --git a/.github/CHANGELOG.md b/.github/CHANGELOG.md index 2212a697..7aa48300 100644 --- a/.github/CHANGELOG.md +++ b/.github/CHANGELOG.md @@ -1,5 +1,13 @@ # ChangeLog +## [0.3.0] - 25-05-2020 + +### Updated + +- `evt@1.6.8` -> `evt@1.7.9` to pull in bug fixes for Deno `>=1.0.2`. +- Moved from `DENO_SUPPORTED_VERSION` to `DENO_SUPPORTED_VERSIONS` +- Added support for `v1.0.2` to CI workflow (`v1.0.1` not supported due to breaking error in Deno). + ## [0.2.0] - 23-05-2020 ### Added diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index c8a67dcf..a26259f7 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -12,7 +12,7 @@ jobs: strategy: matrix: - deno-version: [1.0.0] + deno-version: [1.0.0, 1.0.2] steps: - uses: actions/checkout@v2 diff --git a/README.md b/README.md index 87102368..3f96a879 100644 --- a/README.md +++ b/README.md @@ -22,17 +22,35 @@ This is a [Deno](https://deno.land/) module available to import direct from this Before importing, [download and install Deno](https://deno.land/#installation). +> Please refer to the [version file](./version.ts) for a list of Deno versions supported by Opine. +> +> Once Deno is installed, you can easily switch between Deno versions using the `upgrade` command: +> +> ```bash +> # Upgrade to latest version: +> deno upgrade +> +> # Upgrade to a specific version, replace `` with the version you want (e.g. `1.0.0`): +> deno upgrade --version +> ``` + You can then import Opine straight into your project: ```ts import opine from "https://deno.land/x/opine@master/mod.ts"; ``` -> **Note:** Opine currently only supports Deno v1.0.0 due to some breaking typescript changes introduced in Deno v1.0.1 ([#5704](https://github.com/denoland/deno/issues/5704)). Fixes will be implemented soon, but in the meantime you can set the version of Deno (once installed) using the `upgrade` command: -> -> ```bash -> deno upgrade --version 1.0.0 -> ``` +If you want to use a specific version of Opine, just modify the import url to contain the version: + +```ts +import opine from "https://deno.land/x/opine@0.3.0/mod.ts"; +``` + +Or if you want to use a specific commit of Opine, just modify the import url to contain the commit hash: + +```ts +import opine from "https://deno.land/x/opine@c21f8d6/mod.ts"; +``` ## Features @@ -62,18 +80,28 @@ As time passes, Opine's goals may naturally diverge from [ExpressJS](https://git ## Examples -To view the examples, clone the Opine repo: +To run the [examples](./examples), you have two choices: -```bash -git clone git://github.com/asos-craigmorten/opine.git --depth 1 -cd opine -``` +1. Run the example using Deno directly from GitHub, for example: -Then run whichever example you want: + ```bash + deno run --allow-net --allow-read https://raw.githubusercontent.com/asos-craigmorten/opine/master/examples/hello-world/index.ts + ``` -```bash -deno --allow-net --allow-read ./example/hello-world/index.ts -``` +1. Clone the Opine repo locally: + + ```bash + git clone git://github.com/asos-craigmorten/opine.git --depth 1 + cd opine + ``` + + Then run the example you want: + + ```bash + deno --allow-net --allow-read ./example/hello-world/index.ts + ``` + +All the [examples](./examples) contain example commands in their READMEs to help get you started for either of the above methods. ## Contributing diff --git a/deps.ts b/deps.ts index 11996802..004f8c86 100644 --- a/deps.ts +++ b/deps.ts @@ -27,7 +27,7 @@ export { encoder } from "https://deno.land/std@0.52.0/encoding/utf8.ts"; export { Evt as EventEmitter, to as getEvent, -} from "https://deno.land/x/evt@v1.6.8/mod.ts"; +} from "https://deno.land/x/evt@1.7.9/mod.ts"; export { contentType, charset, diff --git a/docs/_config.yaml b/docs/_config.yaml index 4502f9ce..acb83ab1 100644 --- a/docs/_config.yaml +++ b/docs/_config.yaml @@ -1,3 +1,5 @@ +future: true +encoding: "UTF-8" include: - "_*_.html" - "_*_.*.html" \ No newline at end of file diff --git a/docs/classes/_response_.response.html b/docs/classes/_response_.response.html index 4ceb0939..00d3f5a9 100644 --- a/docs/classes/_response_.response.html +++ b/docs/classes/_response_.response.html @@ -138,7 +138,7 @@

app

@@ -148,7 +148,7 @@

body

@@ -158,7 +158,7 @@

headers

headers: Headers = new Headers()
@@ -168,7 +168,7 @@

locals

locals: any
@@ -178,7 +178,7 @@

req

req: Request
@@ -188,7 +188,7 @@

status

status: Status = 200
@@ -205,7 +205,7 @@

append

  • @@ -240,7 +240,7 @@

    attachment

  • @@ -269,7 +269,7 @@

    clearCookie

  • @@ -298,7 +298,7 @@

    cookie

  • @@ -330,7 +330,7 @@

    download

  • @@ -366,7 +366,7 @@

    end

  • @@ -394,7 +394,7 @@

    etag

  • @@ -427,7 +427,7 @@

    get

  • @@ -456,7 +456,7 @@

    json

  • @@ -488,7 +488,7 @@

    jsonp

  • @@ -520,7 +520,7 @@

    links

  • @@ -554,7 +554,7 @@

    location

  • @@ -589,7 +589,7 @@

    send

  • @@ -621,7 +621,7 @@

    sendFile

  • @@ -650,7 +650,7 @@

    sendStatus

  • @@ -684,7 +684,7 @@

    set

  • @@ -719,7 +719,7 @@

    setStatus

  • @@ -750,7 +750,7 @@

    type

  • @@ -785,7 +785,7 @@

    unset

  • diff --git a/docs/index.html b/docs/index.html index e094354e..14dcf51c 100644 --- a/docs/index.html +++ b/docs/index.html @@ -66,7 +66,7 @@

    opine

    Fast, minimalist web framework for Deno ported from ExpressJS.

    -

    deno doc

    +

    Test deno doc

    import opine from "https://deno.land/x/opine@master/mod.ts";
     
     const app = opine();
    diff --git a/docs/interfaces/_types_.application.html b/docs/interfaces/_types_.application.html
    index b1f66541..752eb418 100644
    --- a/docs/interfaces/_types_.application.html
    +++ b/docs/interfaces/_types_.application.html
    @@ -112,7 +112,7 @@ 

    Callable

  • @@ -135,7 +135,7 @@

    Returns void

    Parameters

    @@ -230,7 +230,7 @@

    _router

    _router: any
    @@ -246,7 +246,7 @@

    all

    @@ -262,7 +262,7 @@

    cache

    cache: any
    @@ -273,7 +273,7 @@

    checkout

    @@ -284,7 +284,7 @@

    connect

    @@ -295,7 +295,7 @@

    copy

    @@ -306,7 +306,7 @@

    delete

    @@ -317,7 +317,7 @@

    get

    @@ -328,7 +328,7 @@

    head

    @@ -338,7 +338,7 @@

    locals

    locals: any
    @@ -349,7 +349,7 @@

    lock

    @@ -360,7 +360,7 @@

    m-search

    @@ -371,7 +371,7 @@

    merge

    @@ -382,7 +382,7 @@

    mkactivity

    @@ -393,7 +393,7 @@

    mkcol

    @@ -403,7 +403,7 @@

    mountpath

    mountpath: string | string[]
    @@ -419,7 +419,7 @@

    move

    @@ -430,7 +430,7 @@

    notify

    @@ -441,7 +441,7 @@

    options

    @@ -451,7 +451,7 @@

    parent

    parent: any
    @@ -462,7 +462,7 @@

    patch

    @@ -473,7 +473,7 @@

    post

    @@ -484,7 +484,7 @@

    propfind

    @@ -495,7 +495,7 @@

    proppatch

    @@ -506,7 +506,7 @@

    purge

    @@ -517,7 +517,7 @@

    put

    @@ -528,7 +528,7 @@

    report

    @@ -538,7 +538,7 @@

    router

    router: string
    @@ -548,7 +548,7 @@

    routes

    routes: any
    @@ -569,7 +569,7 @@

    search

    @@ -579,7 +579,7 @@

    settings

    settings: any
    @@ -590,7 +590,7 @@

    stack

    @@ -606,7 +606,7 @@

    subscribe

    @@ -617,7 +617,7 @@

    trace

    @@ -628,7 +628,7 @@

    unlock

    @@ -639,7 +639,7 @@

    unsubscribe

    @@ -650,7 +650,7 @@

    use

    @@ -667,7 +667,7 @@

    defaultConfiguration

  • @@ -689,7 +689,7 @@

    disable

  • @@ -717,7 +717,7 @@

    disabled

  • @@ -750,7 +750,7 @@

    emit

  • @@ -784,7 +784,7 @@

    enable

  • @@ -812,7 +812,7 @@

    enabled

  • @@ -845,7 +845,7 @@

    handle

  • @@ -881,7 +881,7 @@

    init

  • @@ -908,7 +908,7 @@

    lazyrouter

  • @@ -934,7 +934,7 @@

    listen

  • @@ -954,7 +954,7 @@

    Returns Server

    Parameters

    @@ -968,7 +968,7 @@

    Returns Server

    Parameters

    @@ -991,7 +991,7 @@

    on

  • @@ -1047,7 +1047,7 @@

    path

  • @@ -1076,7 +1076,7 @@

    route

    Parameters

    @@ -1099,7 +1099,7 @@

    set

  • diff --git a/docs/interfaces/_types_.byterange.html b/docs/interfaces/_types_.byterange.html index 05ad6a3b..ad8ebe30 100644 --- a/docs/interfaces/_types_.byterange.html +++ b/docs/interfaces/_types_.byterange.html @@ -97,7 +97,7 @@

    end

    end: number
    @@ -107,7 +107,7 @@

    start

    start: number
    diff --git a/docs/interfaces/_types_.handler.html b/docs/interfaces/_types_.handler.html index 763a62f4..677df58d 100644 --- a/docs/interfaces/_types_.handler.html +++ b/docs/interfaces/_types_.handler.html @@ -103,7 +103,7 @@

    Callable

  • Parameters

    diff --git a/docs/interfaces/_types_.iroute.html b/docs/interfaces/_types_.iroute.html index 0941288e..9b8b9366 100644 --- a/docs/interfaces/_types_.iroute.html +++ b/docs/interfaces/_types_.iroute.html @@ -122,7 +122,7 @@

    all

    all: IRouterHandler<this>
    @@ -132,7 +132,7 @@

    checkout

    checkout: IRouterHandler<this>
    @@ -142,7 +142,7 @@

    copy

    copy: IRouterHandler<this>
    @@ -152,7 +152,7 @@

    delete

    delete: IRouterHandler<this>
    @@ -162,7 +162,7 @@

    dispatch

    dispatch: RequestHandler
    @@ -172,7 +172,7 @@

    get

    get: IRouterHandler<this>
    @@ -182,7 +182,7 @@

    head

    head: IRouterHandler<this>
    @@ -192,7 +192,7 @@

    lock

    lock: IRouterHandler<this>
    @@ -202,7 +202,7 @@

    m-search

    m-search: IRouterHandler<this>
    @@ -212,7 +212,7 @@

    merge

    merge: IRouterHandler<this>
    @@ -222,7 +222,7 @@

    mkactivity

    mkactivity: IRouterHandler<this>
    @@ -232,7 +232,7 @@

    mkcol

    mkcol: IRouterHandler<this>
    @@ -242,7 +242,7 @@

    move

    move: IRouterHandler<this>
    @@ -252,7 +252,7 @@

    notify

    notify: IRouterHandler<this>
    @@ -262,7 +262,7 @@

    options

    options: IRouterHandler<this>
    @@ -272,7 +272,7 @@

    patch

    patch: IRouterHandler<this>
    @@ -282,7 +282,7 @@

    path

    path: string
    @@ -292,7 +292,7 @@

    post

    post: IRouterHandler<this>
    @@ -302,7 +302,7 @@

    purge

    purge: IRouterHandler<this>
    @@ -312,7 +312,7 @@

    put

    put: IRouterHandler<this>
    @@ -322,7 +322,7 @@

    report

    report: IRouterHandler<this>
    @@ -332,7 +332,7 @@

    search

    search: IRouterHandler<this>
    @@ -342,7 +342,7 @@

    stack

    stack: any
    @@ -352,7 +352,7 @@

    subscribe

    subscribe: IRouterHandler<this>
    @@ -362,7 +362,7 @@

    trace

    trace: IRouterHandler<this>
    @@ -372,7 +372,7 @@

    unlock

    unlock: IRouterHandler<this>
    @@ -382,7 +382,7 @@

    unsubscribe

    unsubscribe: IRouterHandler<this>
    diff --git a/docs/interfaces/_types_.irouter.html b/docs/interfaces/_types_.irouter.html index a05a0adb..3fbc204d 100644 --- a/docs/interfaces/_types_.irouter.html +++ b/docs/interfaces/_types_.irouter.html @@ -111,7 +111,7 @@

    Callable

  • Parameters

    @@ -185,7 +185,7 @@

    all

    all: IRouterMatcher<this, "all">
    @@ -201,7 +201,7 @@

    checkout

    checkout: IRouterMatcher<this>
    @@ -211,7 +211,7 @@

    connect

    connect: IRouterMatcher<this>
    @@ -221,7 +221,7 @@

    copy

    copy: IRouterMatcher<this>
    @@ -231,7 +231,7 @@

    delete

    delete: IRouterMatcher<this, "delete">
    @@ -241,7 +241,7 @@

    get

    get: IRouterMatcher<this, "get">
    @@ -251,7 +251,7 @@

    head

    head: IRouterMatcher<this, "head">
    @@ -261,7 +261,7 @@

    lock

    lock: IRouterMatcher<this>
    @@ -271,7 +271,7 @@

    m-search

    m-search: IRouterMatcher<this>
    @@ -281,7 +281,7 @@

    merge

    merge: IRouterMatcher<this>
    @@ -291,7 +291,7 @@

    mkactivity

    mkactivity: IRouterMatcher<this>
    @@ -301,7 +301,7 @@

    mkcol

    mkcol: IRouterMatcher<this>
    @@ -311,7 +311,7 @@

    move

    move: IRouterMatcher<this>
    @@ -321,7 +321,7 @@

    notify

    notify: IRouterMatcher<this>
    @@ -331,7 +331,7 @@

    options

    options: IRouterMatcher<this, "options">
    @@ -341,7 +341,7 @@

    patch

    patch: IRouterMatcher<this, "patch">
    @@ -351,7 +351,7 @@

    post

    post: IRouterMatcher<this, "post">
    @@ -361,7 +361,7 @@

    propfind

    propfind: IRouterMatcher<this>
    @@ -371,7 +371,7 @@

    proppatch

    proppatch: IRouterMatcher<this>
    @@ -381,7 +381,7 @@

    purge

    purge: IRouterMatcher<this>
    @@ -391,7 +391,7 @@

    put

    put: IRouterMatcher<this, "put">
    @@ -401,7 +401,7 @@

    report

    report: IRouterMatcher<this>
    @@ -411,7 +411,7 @@

    search

    search: IRouterMatcher<this>
    @@ -421,7 +421,7 @@

    stack

    stack: any[]
    @@ -436,7 +436,7 @@

    subscribe

    subscribe: IRouterMatcher<this>
    @@ -446,7 +446,7 @@

    trace

    trace: IRouterMatcher<this>
    @@ -456,7 +456,7 @@

    unlock

    unlock: IRouterMatcher<this>
    @@ -466,7 +466,7 @@

    unsubscribe

    unsubscribe: IRouterMatcher<this>
    @@ -476,7 +476,7 @@

    use

    use: IRouterHandler<this> & IRouterMatcher<this>
    @@ -493,7 +493,7 @@

    route

  • Parameters

    diff --git a/docs/interfaces/_types_.irouterhandler.html b/docs/interfaces/_types_.irouterhandler.html index 67f6c2d6..d7c766d2 100644 --- a/docs/interfaces/_types_.irouterhandler.html +++ b/docs/interfaces/_types_.irouterhandler.html @@ -93,7 +93,7 @@

    Callable

  • Parameters

    @@ -107,7 +107,7 @@

    Returns T<
  • Parameters

    diff --git a/docs/interfaces/_types_.iroutermatcher.html b/docs/interfaces/_types_.iroutermatcher.html index 62c6d335..5a559f70 100644 --- a/docs/interfaces/_types_.iroutermatcher.html +++ b/docs/interfaces/_types_.iroutermatcher.html @@ -97,7 +97,7 @@

    Callable

  • Type parameters

    @@ -129,7 +129,7 @@

    Returns T<
  • Type parameters

    @@ -161,7 +161,7 @@

    Returns T<
  • Parameters

    diff --git a/docs/interfaces/_types_.mediatype.html b/docs/interfaces/_types_.mediatype.html index 0b7c29af..bd1c896b 100644 --- a/docs/interfaces/_types_.mediatype.html +++ b/docs/interfaces/_types_.mediatype.html @@ -99,7 +99,7 @@

    quality

    quality: number
    @@ -109,7 +109,7 @@

    subtype

    subtype: string
    @@ -119,7 +119,7 @@

    type

    type: string
    @@ -129,7 +129,7 @@

    value

    value: string
    diff --git a/docs/interfaces/_types_.nextfunction.html b/docs/interfaces/_types_.nextfunction.html index 04ddb177..fcf30f22 100644 --- a/docs/interfaces/_types_.nextfunction.html +++ b/docs/interfaces/_types_.nextfunction.html @@ -85,7 +85,7 @@

    Callable

  • Parameters

    @@ -99,7 +99,7 @@

    Returns void
    diff --git a/docs/interfaces/_types_.opine.html b/docs/interfaces/_types_.opine.html index 61dcbb25..77101e0a 100644 --- a/docs/interfaces/_types_.opine.html +++ b/docs/interfaces/_types_.opine.html @@ -104,7 +104,7 @@

    Callable

  • @@ -127,7 +127,7 @@

    Returns void

    Parameters

    @@ -225,7 +225,7 @@

    _router

    @@ -241,7 +241,7 @@

    all

    @@ -258,7 +258,7 @@

    cache

    @@ -269,7 +269,7 @@

    checkout

    @@ -280,7 +280,7 @@

    connect

    @@ -291,7 +291,7 @@

    copy

    @@ -302,7 +302,7 @@

    delete

    @@ -314,7 +314,7 @@

    get

    Inherited from Application.get

    Overrides IRouter.get

    @@ -325,7 +325,7 @@

    head

    @@ -336,7 +336,7 @@

    locals

    @@ -347,7 +347,7 @@

    lock

    @@ -358,7 +358,7 @@

    m-search

    @@ -369,7 +369,7 @@

    merge

    @@ -380,7 +380,7 @@

    mkactivity

    @@ -391,7 +391,7 @@

    mkcol

    @@ -402,7 +402,7 @@

    mountpath

    @@ -418,7 +418,7 @@

    move

    @@ -429,7 +429,7 @@

    notify

    @@ -440,7 +440,7 @@

    options

    @@ -451,7 +451,7 @@

    parent

    @@ -462,7 +462,7 @@

    patch

    @@ -473,7 +473,7 @@

    post

    @@ -484,7 +484,7 @@

    propfind

    @@ -495,7 +495,7 @@

    proppatch

    @@ -506,7 +506,7 @@

    purge

    @@ -517,7 +517,7 @@

    put

    @@ -528,7 +528,7 @@

    report

    @@ -538,7 +538,7 @@

    request

    request: Request
    @@ -548,7 +548,7 @@

    response

    response: Response
    @@ -559,7 +559,7 @@

    router

    @@ -570,7 +570,7 @@

    routes

    @@ -591,7 +591,7 @@

    search

    @@ -602,7 +602,7 @@

    settings

    @@ -613,7 +613,7 @@

    stack

    @@ -629,7 +629,7 @@

    subscribe

    @@ -640,7 +640,7 @@

    trace

    @@ -651,7 +651,7 @@

    unlock

    @@ -662,7 +662,7 @@

    unsubscribe

    @@ -674,7 +674,7 @@

    use

    Inherited from Application.use

    Overrides IRouter.use

    @@ -692,7 +692,7 @@

    defaultConfiguration

    @@ -715,7 +715,7 @@

    disable

    @@ -744,7 +744,7 @@

    disabled

    @@ -778,7 +778,7 @@

    emit

    @@ -813,7 +813,7 @@

    enable

    @@ -842,7 +842,7 @@

    enabled

    @@ -876,7 +876,7 @@

    handle

    @@ -913,7 +913,7 @@

    init

    @@ -941,7 +941,7 @@

    lazyrouter

    @@ -968,7 +968,7 @@

    listen

    @@ -989,7 +989,7 @@

    Returns Server

    Inherited from Application.listen

    Parameters

    @@ -1004,7 +1004,7 @@

    Returns Server

    Inherited from Application.listen

    Parameters

    @@ -1028,7 +1028,7 @@

    on

    @@ -1085,7 +1085,7 @@

    path

    @@ -1114,7 +1114,7 @@

    route

    Parameters

    @@ -1138,7 +1138,7 @@

    set

    diff --git a/docs/interfaces/_types_.request.html b/docs/interfaces/_types_.request.html index 6dd9deb9..00e8a733 100644 --- a/docs/interfaces/_types_.request.html +++ b/docs/interfaces/_types_.request.html @@ -150,7 +150,7 @@

    Optional _parsedUrl

    _parsedUrl: ParsedURL
    @@ -160,7 +160,7 @@

    Optional _url

    _url: string
    @@ -170,7 +170,7 @@

    app

    @@ -180,7 +180,7 @@

    baseUrl

    baseUrl: string
    @@ -190,7 +190,7 @@

    fresh

    fresh: boolean
    @@ -207,7 +207,7 @@

    get

    get: (name: string) => string
    @@ -254,7 +254,7 @@

    Optional next

    @@ -264,7 +264,7 @@

    originalUrl

    originalUrl: string
    @@ -274,7 +274,7 @@

    params

    params: P
    @@ -284,7 +284,7 @@

    query

    query: ReqQuery
    @@ -294,7 +294,7 @@

    Optional res

    res: Response<ResBody>
    @@ -310,7 +310,7 @@

    route

    route: any
    diff --git a/docs/interfaces/_types_.requesthandler.html b/docs/interfaces/_types_.requesthandler.html index c74e7d7d..276f6582 100644 --- a/docs/interfaces/_types_.requesthandler.html +++ b/docs/interfaces/_types_.requesthandler.html @@ -106,7 +106,7 @@

    Callable

  • Parameters

    diff --git a/docs/interfaces/_types_.response.html b/docs/interfaces/_types_.response.html index 762a5bd5..482abda5 100644 --- a/docs/interfaces/_types_.response.html +++ b/docs/interfaces/_types_.response.html @@ -137,7 +137,7 @@

    app

    @@ -147,7 +147,7 @@

    json

    json: Send<ResBody, this>
    @@ -167,7 +167,7 @@

    jsonp

    jsonp: Send<ResBody, this>
    @@ -187,7 +187,7 @@

    locals

    locals: any
    @@ -197,7 +197,7 @@

    Optional req

    req: Request
    @@ -207,7 +207,7 @@

    send

    send: Send<ResBody, this>
    @@ -227,7 +227,7 @@

    Optional statusMessagestatusMessage: any

    @@ -244,7 +244,7 @@

    append

  • @@ -278,7 +278,7 @@

    attachment

  • @@ -307,7 +307,7 @@

    clearCookie

  • @@ -326,7 +326,7 @@

    Returns this
    @@ -354,7 +354,7 @@

    cookie

  • @@ -386,7 +386,7 @@

    download

  • @@ -407,7 +407,7 @@

    Returns Promise

    Parameters

    @@ -434,7 +434,7 @@

    end

  • @@ -455,7 +455,7 @@

    Returns Promise

    Parameters

    @@ -478,7 +478,7 @@

    get

  • @@ -506,7 +506,7 @@

    links

  • @@ -539,7 +539,7 @@

    sendFile

  • @@ -585,7 +585,7 @@

    sendStatus

  • @@ -618,7 +618,7 @@

    set

  • @@ -652,7 +652,7 @@

    setStatus

  • @@ -680,7 +680,7 @@

    type

  • @@ -714,7 +714,7 @@

    unset

  • diff --git a/docs/interfaces/_types_.router.html b/docs/interfaces/_types_.router.html index dd656008..ad56de9d 100644 --- a/docs/interfaces/_types_.router.html +++ b/docs/interfaces/_types_.router.html @@ -103,7 +103,7 @@

    Callable

  • Parameters

    @@ -178,7 +178,7 @@

    all

    @@ -195,7 +195,7 @@

    checkout

    @@ -206,7 +206,7 @@

    connect

    @@ -217,7 +217,7 @@

    copy

    @@ -228,7 +228,7 @@

    delete

    @@ -239,7 +239,7 @@

    get

    @@ -250,7 +250,7 @@

    head

    @@ -261,7 +261,7 @@

    lock

    @@ -272,7 +272,7 @@

    m-search

    @@ -283,7 +283,7 @@

    merge

    @@ -294,7 +294,7 @@

    mkactivity

    @@ -305,7 +305,7 @@

    mkcol

    @@ -316,7 +316,7 @@

    move

    @@ -327,7 +327,7 @@

    notify

    @@ -338,7 +338,7 @@

    options

    @@ -349,7 +349,7 @@

    patch

    @@ -360,7 +360,7 @@

    post

    @@ -371,7 +371,7 @@

    propfind

    @@ -382,7 +382,7 @@

    proppatch

    @@ -393,7 +393,7 @@

    purge

    @@ -404,7 +404,7 @@

    put

    @@ -415,7 +415,7 @@

    report

    @@ -426,7 +426,7 @@

    search

    @@ -437,7 +437,7 @@

    stack

    @@ -453,7 +453,7 @@

    subscribe

    @@ -464,7 +464,7 @@

    trace

    @@ -475,7 +475,7 @@

    unlock

    @@ -486,7 +486,7 @@

    unsubscribe

    @@ -497,7 +497,7 @@

    use

    @@ -515,7 +515,7 @@

    route

    Parameters

    diff --git a/docs/modules/_application_.html b/docs/modules/_application_.html index 90a76e69..2a64c041 100644 --- a/docs/modules/_application_.html +++ b/docs/modules/_application_.html @@ -88,7 +88,7 @@

    Const app

    app: Application = {} as Application
    @@ -103,7 +103,7 @@

    Const create

    create: create = Object.create
    @@ -113,7 +113,7 @@

    Const setPrototypeOfsetPrototypeOf: any = Object.setPrototypeOf

    @@ -123,7 +123,7 @@

    Const slice

    slice: slice = Array.prototype.slice
    diff --git a/docs/modules/_methods_.html b/docs/modules/_methods_.html index 3a11edef..925b000c 100644 --- a/docs/modules/_methods_.html +++ b/docs/modules/_methods_.html @@ -85,7 +85,7 @@

    Const methods

    methods: string[] = ["get","post","put","head","delete","options","trace","copy","lock","mkcol","move","purge","propfind","proppatch","unlock","report","mkactivity","checkout","merge","m-search","notify","subscribe","unsubscribe","patch","search","connect",]
    diff --git a/docs/modules/_middleware_bodyparser_getcharset_.html b/docs/modules/_middleware_bodyparser_getcharset_.html index 4236dcab..df070949 100644 --- a/docs/modules/_middleware_bodyparser_getcharset_.html +++ b/docs/modules/_middleware_bodyparser_getcharset_.html @@ -89,7 +89,7 @@

    Private getCharset

  • diff --git a/docs/modules/_middleware_bodyparser_hasbody_.html b/docs/modules/_middleware_bodyparser_hasbody_.html index 828c898d..8c05d580 100644 --- a/docs/modules/_middleware_bodyparser_hasbody_.html +++ b/docs/modules/_middleware_bodyparser_hasbody_.html @@ -89,7 +89,7 @@

    Private hasBody

  • diff --git a/docs/modules/_middleware_bodyparser_json_.html b/docs/modules/_middleware_bodyparser_json_.html index 4b98e1be..ffccb2cb 100644 --- a/docs/modules/_middleware_bodyparser_json_.html +++ b/docs/modules/_middleware_bodyparser_json_.html @@ -94,7 +94,7 @@

    Const FIRST_CHAR_REGEXP
    FIRST_CHAR_REGEXP: RegExp = /^[\x20\x09\x0a\x0d]*(.)/
    @@ -122,7 +122,7 @@

    Private createStrictS
  • @@ -153,7 +153,7 @@

    Private firstChar

  • @@ -181,7 +181,7 @@

    json

  • @@ -209,7 +209,7 @@

    normalizeJsonSyntaxError

  • diff --git a/docs/modules/_middleware_bodyparser_raw_.html b/docs/modules/_middleware_bodyparser_raw_.html index 290a10a9..0eea1855 100644 --- a/docs/modules/_middleware_bodyparser_raw_.html +++ b/docs/modules/_middleware_bodyparser_raw_.html @@ -89,7 +89,7 @@

    raw

  • diff --git a/docs/modules/_middleware_bodyparser_read_.html b/docs/modules/_middleware_bodyparser_read_.html index 74b745d8..073f0974 100644 --- a/docs/modules/_middleware_bodyparser_read_.html +++ b/docs/modules/_middleware_bodyparser_read_.html @@ -92,7 +92,7 @@

    Const decoder

    decoder: TextDecoder = new TextDecoder()
    @@ -109,7 +109,7 @@

    Private getBodyReader
  • @@ -140,7 +140,7 @@

    Private read

  • diff --git a/docs/modules/_middleware_bodyparser_text_.html b/docs/modules/_middleware_bodyparser_text_.html index dabd9904..82a0ae1b 100644 --- a/docs/modules/_middleware_bodyparser_text_.html +++ b/docs/modules/_middleware_bodyparser_text_.html @@ -89,7 +89,7 @@

    text

  • diff --git a/docs/modules/_middleware_bodyparser_typechecker_.html b/docs/modules/_middleware_bodyparser_typechecker_.html index 8f6974ec..53b62bb0 100644 --- a/docs/modules/_middleware_bodyparser_typechecker_.html +++ b/docs/modules/_middleware_bodyparser_typechecker_.html @@ -91,7 +91,7 @@

    normalize

  • Parameters

    @@ -114,7 +114,7 @@

    typeChecker

  • @@ -142,7 +142,7 @@

    typeIs

  • Parameters

    diff --git a/docs/modules/_middleware_bodyparser_urlencoded_.html b/docs/modules/_middleware_bodyparser_urlencoded_.html index bbc2339b..3d06f5d0 100644 --- a/docs/modules/_middleware_bodyparser_urlencoded_.html +++ b/docs/modules/_middleware_bodyparser_urlencoded_.html @@ -89,7 +89,7 @@

    urlencoded

  • diff --git a/docs/modules/_middleware_init_.html b/docs/modules/_middleware_init_.html index 6d9960b1..1fa62aa7 100644 --- a/docs/modules/_middleware_init_.html +++ b/docs/modules/_middleware_init_.html @@ -92,7 +92,7 @@

    Const create

    create: create = Object.create
    @@ -102,7 +102,7 @@

    Const setPrototypeOfsetPrototypeOf: any = Object.setPrototypeOf

    @@ -119,7 +119,7 @@

    Private
    diff --git a/docs/modules/_middleware_query_.html b/docs/modules/_middleware_query_.html index 7afb9960..7759f2cd 100644 --- a/docs/modules/_middleware_query_.html +++ b/docs/modules/_middleware_query_.html @@ -89,7 +89,7 @@

    Const query

  • diff --git a/docs/modules/_opine_.html b/docs/modules/_opine_.html index e1e0caf9..13664dd0 100644 --- a/docs/modules/_opine_.html +++ b/docs/modules/_opine_.html @@ -91,7 +91,7 @@

    Const response

    response: Response = Object.create(ServerResponse.prototype)
    @@ -113,7 +113,7 @@

    opine

  • diff --git a/docs/modules/_request_.html b/docs/modules/_request_.html index 5e4341fd..cbace526 100644 --- a/docs/modules/_request_.html +++ b/docs/modules/_request_.html @@ -85,7 +85,7 @@

    Const request

    request: Request = Object.create(ServerRequest.prototype)
    diff --git a/docs/modules/_router_index_.html b/docs/modules/_router_index_.html index b8a8743e..c244aded 100644 --- a/docs/modules/_router_index_.html +++ b/docs/modules/_router_index_.html @@ -100,7 +100,7 @@

    Const objectRegExp

    objectRegExp: RegExp = /^\[object (\S+)\]$/
    @@ -110,7 +110,7 @@

    Const setPrototypeOfsetPrototypeOf: any = Object.setPrototypeOf

    @@ -127,7 +127,7 @@

    Const Router

  • @@ -156,7 +156,7 @@

    appendMethods

  • Parameters

    @@ -182,7 +182,7 @@

    getProtohost

  • Parameters

    @@ -205,7 +205,7 @@

    gettype

  • Parameters

    @@ -228,7 +228,7 @@

    Private matchLayer

  • @@ -259,7 +259,7 @@

    mergeParams

  • Parameters

    @@ -285,7 +285,7 @@

    restore

  • Parameters

    @@ -311,7 +311,7 @@

    sendOptionsResponse

  • Parameters

    @@ -340,7 +340,7 @@

    wrap

  • Parameters

    diff --git a/docs/modules/_router_layer_.html b/docs/modules/_router_layer_.html index 9ccafde9..d6d60db8 100644 --- a/docs/modules/_router_layer_.html +++ b/docs/modules/_router_layer_.html @@ -90,7 +90,7 @@

    Const Layer

  • Parameters

    @@ -122,7 +122,7 @@

    Private decode_param

  • diff --git a/docs/modules/_router_route_.html b/docs/modules/_router_route_.html index 55744840..bf402fe1 100644 --- a/docs/modules/_router_route_.html +++ b/docs/modules/_router_route_.html @@ -89,7 +89,7 @@

    Const Route

  • diff --git a/docs/modules/_types_.html b/docs/modules/_types_.html index 5ecbf301..28610b26 100644 --- a/docs/modules/_types_.html +++ b/docs/modules/_types_.html @@ -125,7 +125,7 @@

    ApplicationRequestHandler

    ApplicationRequestHandler<T>: IRouterHandler<T> & IRouterMatcher<T> & (...handlers: RequestHandlerParams[]) => T

    Type parameters

    @@ -141,7 +141,7 @@

    DenoResponseBody

    DenoResponseBody: string | Uint8Array | Deno.Reader
    @@ -151,7 +151,7 @@

    Errback

    Errback: (err: Error) => void
    @@ -182,7 +182,7 @@

    ErrorRequestHandler

    ErrorRequestHandler<P, ResBody, ReqQuery>: (err: any, req: Request<P, ResBody, ReqQuery>, res: Response<ResBody>, next: NextFunction) => any

    Type parameters

    @@ -234,7 +234,7 @@

    Params

    @@ -244,7 +244,7 @@

    ParamsArray

    ParamsArray: string[]
    @@ -254,7 +254,7 @@

    ParsedURL

    ParsedURL: URL & { _raw?: string }
    @@ -264,7 +264,7 @@

    PathParams

    PathParams: string | RegExp | Array<string | RegExp>
    @@ -274,7 +274,7 @@

    RequestHandlerParams

    RequestHandlerParams<P, ResBody, ReqQuery>: RequestHandler<P, ResBody, ReqQuery> | ErrorRequestHandler<P, ResBody, ReqQuery> | Array<RequestHandler<P> | ErrorRequestHandler<P>>

    Type parameters

    @@ -296,7 +296,7 @@

    RequestParamHandler

    RequestParamHandler: (req: Request, res: Response, next: NextFunction, value: any, name: string) => any
    @@ -339,7 +339,7 @@

    ResponseBody

    ResponseBody: number | boolean | object | DenoResponseBody
    @@ -349,7 +349,7 @@

    Send

    Send<ResBody, T>: (body?: ResBody) => T

    Type parameters

    diff --git a/docs/modules/_utils_compileetag_.html b/docs/modules/_utils_compileetag_.html index 8cee30b6..09a3962d 100644 --- a/docs/modules/_utils_compileetag_.html +++ b/docs/modules/_utils_compileetag_.html @@ -93,7 +93,7 @@

    Private etag: Function = createETagGenerator({ weak: false })

    @@ -116,7 +116,7 @@

    Private wetag: Function = createETagGenerator({ weak: true })

    @@ -146,7 +146,7 @@

    Const compileETag

  • @@ -179,7 +179,7 @@

    Private createETagGenerato
  • diff --git a/docs/modules/_utils_contentdisposition_.html b/docs/modules/_utils_contentdisposition_.html index db40da1f..029d4fd8 100644 --- a/docs/modules/_utils_contentdisposition_.html +++ b/docs/modules/_utils_contentdisposition_.html @@ -89,7 +89,7 @@

    Const contentDisposition

    diff --git a/docs/modules/_utils_definegetter_.html b/docs/modules/_utils_definegetter_.html index fd36b960..b092c0f2 100644 --- a/docs/modules/_utils_definegetter_.html +++ b/docs/modules/_utils_definegetter_.html @@ -89,7 +89,7 @@

    Private defineGetter

  • diff --git a/docs/modules/_utils_encodeurl_.html b/docs/modules/_utils_encodeurl_.html index 8a55cef4..4bce8496 100644 --- a/docs/modules/_utils_encodeurl_.html +++ b/docs/modules/_utils_encodeurl_.html @@ -93,7 +93,7 @@

    Private ENCODE_CHARS_REGEXP: RegExp = /(?:[^\x21\x25\x26-\x3B\x3D\x3F-\x5B\x5D\x5F\x61-\x7A\x7E]|%(?:[^0-9A-Fa-f]|[0-9A-Fa-f][^0-9A-Fa-f]|$))+/g

    @@ -109,7 +109,7 @@

    Private UNMATCHED_SURROGATE_PAIR_REGEXP: RegExp = /(^|[^\uD800-\uDBFF])[\uDC00-\uDFFF]|[\uD800-\uDBFF]([^\uDC00-\uDFFF]|$)/g

    @@ -124,7 +124,7 @@

    Private UNMATCHED_SURROGATE_PAIR_REPLACE: "$1�$2" = "$1�$2"

    @@ -146,7 +146,7 @@

    encodeUrl

  • diff --git a/docs/modules/_utils_escapehtml_.html b/docs/modules/_utils_escapehtml_.html index 8dd9a020..886850f9 100644 --- a/docs/modules/_utils_escapehtml_.html +++ b/docs/modules/_utils_escapehtml_.html @@ -91,7 +91,7 @@

    Const matchHtmlReg
    matchHtmlRegExp: RegExp = /["'&<>]/
    @@ -108,7 +108,7 @@

    escapeHtml

  • diff --git a/docs/modules/_utils_etag_.html b/docs/modules/_utils_etag_.html index b3e3bb9b..04b1f4ad 100644 --- a/docs/modules/_utils_etag_.html +++ b/docs/modules/_utils_etag_.html @@ -94,7 +94,7 @@

    Const toString

    toString: toString = Object.prototype.toString
    @@ -111,7 +111,7 @@

    Private entitytag

  • @@ -140,7 +140,7 @@

    etag

  • @@ -171,7 +171,7 @@

    Private isstats

  • @@ -199,7 +199,7 @@

    Private stattag

  • diff --git a/docs/modules/_utils_finalhandler_.html b/docs/modules/_utils_finalhandler_.html index e440083f..ba3e4be8 100644 --- a/docs/modules/_utils_finalhandler_.html +++ b/docs/modules/_utils_finalhandler_.html @@ -100,7 +100,7 @@

    Const DOUBLE_SPACE_REGE
    DOUBLE_SPACE_REGEXP: RegExp = /\x20{2}/g
    @@ -110,7 +110,7 @@

    Const NEWLINE_REGEXP

    NEWLINE_REGEXP: RegExp = /\n/g
    @@ -127,7 +127,7 @@

    Private createHtmlDoc
  • @@ -155,7 +155,7 @@

    finalHandler

  • @@ -186,7 +186,7 @@

    Private getErrorHeade
  • @@ -214,7 +214,7 @@

    Private getErrorMessa
  • @@ -245,7 +245,7 @@

    Private getErrorStatu
  • @@ -273,7 +273,7 @@

    Private getResourceNa
  • @@ -303,7 +303,7 @@

    Private getResponseSt
  • @@ -331,7 +331,7 @@

    Private send

  • @@ -371,7 +371,7 @@

    Private setHeaders

  • diff --git a/docs/modules/_utils_fresh_.html b/docs/modules/_utils_fresh_.html index 96656f49..0c572609 100644 --- a/docs/modules/_utils_fresh_.html +++ b/docs/modules/_utils_fresh_.html @@ -93,7 +93,7 @@

    Const CACHE_CONTROL_NO_
    CACHE_CONTROL_NO_CACHE_REGEXP: RegExp = /(?:^|,)\s*?no-cache\s*?(?:,|$)/
    @@ -110,7 +110,7 @@

    fresh

  • @@ -141,7 +141,7 @@

    Private parseHttpDate
  • @@ -169,7 +169,7 @@

    Private parseTokenLis
  • diff --git a/docs/modules/_utils_merge_.html b/docs/modules/_utils_merge_.html index 807746ac..cd587055 100644 --- a/docs/modules/_utils_merge_.html +++ b/docs/modules/_utils_merge_.html @@ -96,7 +96,7 @@

    merge

  • diff --git a/docs/modules/_utils_mergedescriptors_.html b/docs/modules/_utils_mergedescriptors_.html index 354e10d5..91410577 100644 --- a/docs/modules/_utils_mergedescriptors_.html +++ b/docs/modules/_utils_mergedescriptors_.html @@ -91,7 +91,7 @@

    Const hasOwnPropertyhasOwnProperty: hasOwnProperty = Object.prototype.hasOwnProperty

    @@ -108,7 +108,7 @@

    mergeDescriptors

  • diff --git a/docs/modules/_utils_pathtoregex_.html b/docs/modules/_utils_pathtoregex_.html index b7c98395..e6515ec3 100644 --- a/docs/modules/_utils_pathtoregex_.html +++ b/docs/modules/_utils_pathtoregex_.html @@ -71,7 +71,7 @@

    Module "utils/pathToRegex"

    Source: https://github.com/pillarjs/path-to-regexp/tree/v0.1.7 Raw: https://raw.githubusercontent.com/pillarjs/path-to-regexp/v0.1.7/index.js

    -

    Copyright (c) 2014 Blake Embrey (hello@blakeembrey.com)

    +

    Copyright (c) 2014 Blake Embrey (hello@blakeembrey.com)

  • @@ -108,7 +108,7 @@

    Path

    Path: string | RegExp | PathArray
    @@ -118,7 +118,7 @@

    PathArray

    PathArray: (string | RegExp)[]
    @@ -131,7 +131,7 @@

    Const MATCHING_GROUP_RE
    MATCHING_GROUP_REGEXP: RegExp = /\((?!\?)/g
    @@ -153,7 +153,7 @@

    Private pathToRegexp

  • diff --git a/docs/modules/_utils_stringify_.html b/docs/modules/_utils_stringify_.html index 6d504646..4a5aec8e 100644 --- a/docs/modules/_utils_stringify_.html +++ b/docs/modules/_utils_stringify_.html @@ -89,7 +89,7 @@

    stringify

  • diff --git a/docs/modules/_utils_url_.html b/docs/modules/_utils_url_.html index 347d6287..a5059625 100644 --- a/docs/modules/_utils_url_.html +++ b/docs/modules/_utils_url_.html @@ -92,7 +92,7 @@

    Const fillInProtocol

    fillInProtocol: "http://" = "http://"
    @@ -102,7 +102,7 @@

    Const fillInProtohost

    fillInProtohost: "deno.land" = "deno.land"
    @@ -119,7 +119,7 @@

    Const parseUrl

  • diff --git a/examples/downloads/README.md b/examples/downloads/README.md new file mode 100644 index 00000000..44d854ee --- /dev/null +++ b/examples/downloads/README.md @@ -0,0 +1,15 @@ +# downloads + +Run this example using: + +```bash +deno run --allow-net --allow-read ./examples/downloads/index.ts +``` + +if have the repo cloned locally _OR_ + +```bash +deno run --allow-net --allow-read https://raw.githubusercontent.com/asos-craigmorten/opine/master/examples/downloads/index.ts +``` + +if you don't! diff --git a/examples/downloads/index.ts b/examples/downloads/index.ts index bfcc2149..abbc5bfc 100644 --- a/examples/downloads/index.ts +++ b/examples/downloads/index.ts @@ -1,3 +1,16 @@ +/** + * Run this example using: + * + * deno run --allow-net --allow-read ./examples/downloads/index.ts + * + * if have the repo cloned locally OR + * + * deno run --allow-net --allow-read https://raw.githubusercontent.com/asos-craigmorten/opine/master/examples/downloads/index.ts + * + * if you don't! + * + */ + import { dirname, join } from "https://deno.land/std/path/mod.ts"; import opine from "../../mod.ts"; @@ -14,12 +27,15 @@ app.get("/", function (_req, res) { ); }); +// If we used `/files/*`, the name could be accessed via req.params[0] +// but here we have named it using :file app.get("/files/:file(*)", async function (req, res, next) { const filePath = join(__dirname, "files", req.params.file); try { await res.download(filePath); } catch (err) { + // file for download not found if (err instanceof Deno.errors.NotFound) { res.status = 404; res.send("Cant find that file, sorry!"); @@ -27,6 +43,7 @@ app.get("/files/:file(*)", async function (req, res, next) { return; } + // non-404 error return next(err); } }); diff --git a/examples/error/README.md b/examples/error/README.md new file mode 100644 index 00000000..32d324e5 --- /dev/null +++ b/examples/error/README.md @@ -0,0 +1,15 @@ +# error + +Run this example using: + +```bash +deno run --allow-net ./examples/error/index.ts +``` + +if have the repo cloned locally _OR_ + +```bash +deno run --allow-net https://raw.githubusercontent.com/asos-craigmorten/opine/master/examples/error/index.ts +``` + +if you don't! diff --git a/examples/error/index.ts b/examples/error/index.ts index 020615a0..4fcf26c7 100644 --- a/examples/error/index.ts +++ b/examples/error/index.ts @@ -1,3 +1,16 @@ +/** + * Run this example using: + * + * deno run --allow-net ./examples/error/index.ts + * + * if have the repo cloned locally _OR_ + * + * deno run --allow-net https://raw.githubusercontent.com/asos-craigmorten/opine/master/examples/error/index.ts + * + * if you don't! + * + */ + import opine from "../../mod.ts"; import { Response, Request, NextFunction } from "../../typings/index.d.ts"; @@ -8,12 +21,15 @@ const app = opine(); // otherwise they behave exactly like regular // middleware, you may have several of them, // in different orders etc. + function error(err: any, _req: Request, res: Response, _next: NextFunction) { + // respond with custom 500 "Internal Server Error". res.setStatus(500); res.json({ message: "Internal Server Error", error: err.message }); } app.get("/", function (_req, _res) { + // Caught and passed down to the errorHandler middleware throw new Error("sync error"); }); diff --git a/examples/hello-world/README.md b/examples/hello-world/README.md new file mode 100644 index 00000000..840cf2cb --- /dev/null +++ b/examples/hello-world/README.md @@ -0,0 +1,15 @@ +# hello-world + +Run this example using: + +```bash +deno run --allow-net ./examples/hello-world/index.ts +``` + +if have the repo cloned locally _OR_ + +```bash +deno run --allow-net https://raw.githubusercontent.com/asos-craigmorten/opine/master/examples/hello-world/index.ts +``` + +if you don't! diff --git a/examples/hello-world/index.ts b/examples/hello-world/index.ts index b74118d0..eb95f79e 100644 --- a/examples/hello-world/index.ts +++ b/examples/hello-world/index.ts @@ -1,3 +1,16 @@ +/** + * Run this example using: + * + * deno run --allow-net ./examples/hello-world/index.ts + * + * if have the repo cloned locally OR + * + * deno run --allow-net https://raw.githubusercontent.com/asos-craigmorten/opine/master/examples/hello-world/index.ts + * + * if you don't! + * + */ + import opine from "../../mod.ts"; const app = opine(); diff --git a/examples/multi-router/README.md b/examples/multi-router/README.md new file mode 100644 index 00000000..ff564052 --- /dev/null +++ b/examples/multi-router/README.md @@ -0,0 +1,15 @@ +# multi-router + +Run this example using: + +```bash +deno run --allow-net ./examples/multi-router/index.ts +``` + +if have the repo cloned locally _OR_ + +```bash +deno run --allow-net https://raw.githubusercontent.com/asos-craigmorten/opine/master/examples/multi-router/index.ts +``` + +if you don't! diff --git a/examples/multi-router/index.ts b/examples/multi-router/index.ts index b5b803de..b2ba49a9 100644 --- a/examples/multi-router/index.ts +++ b/examples/multi-router/index.ts @@ -1,3 +1,16 @@ +/** + * Run this example using: + * + * deno run --allow-net ./examples/multi-router/index.ts + * + * if have the repo cloned locally OR + * + * deno run --allow-net https://raw.githubusercontent.com/asos-craigmorten/opine/master/examples/multi-router/index.ts + * + * if you don't! + * + */ + import opine from "../../mod.ts"; import APIv1 from "./controllers/APIv1.ts"; import APIv2 from "./controllers/APIv2.ts"; diff --git a/lock.json b/lock.json index c011ed4f..d8ca1807 100644 --- a/lock.json +++ b/lock.json @@ -1,116 +1,116 @@ { - "https://deno.land/x/media_types@v2.3.1/deps.ts": "02a37b0bef1e1aed7afcac7fd482aecd2598722914239ff5ca1cae0a8b7cd2ca", - "https://deno.land/x/evt@v1.6.8/deno_dist/lib/util/compose.ts": "f26d1d12d171697aeec27982c6d1a38e4fbcc9f7cdd86e6c7df62159f4f37abf", - "https://deno.land/std@0.52.0/path/common.ts": "95115757c9dc9e433a641f80ee213553b6752aa6fbb87eb9f16f6045898b6b14", - "https://raw.githubusercontent.com/garronej/run_exclusive/v2.1.12/mod.ts": "2f1088a4691d003be0a678c7bca81de1f1a2534feecab36b7faa9ce91b05bb80", - "https://deno.land/x/evt@v1.6.8/deno_dist/lib/Evt.newCtx.ts": "3e5e660eacb5af62b0e585a2206d06e5ed4680dadf198f8dcc569d52452f59a4", - "https://deno.land/x/evt@v1.6.8/deno_dist/tools/Deferred.ts": "d7fde0179647da5c3b8f85a1ad316304c2ee63991db22f3421ac3c342a98af10", - "https://deno.land/x/evt@v1.6.8/deno_dist/lib/Evt.ts": "4347dbf01166b1900d63498b204aebebcd12714669d987cfbcd133a2cb6593a9", - "https://deno.land/x/evt@v1.6.8/deno_dist/lib/types/helper/index.ts": "c6177abf99ec1f7ced101b5ddbd551797809f04e72ebf2f2d203e76c521ebd6b", - "https://deno.land/x/oak@v4.0.0/httpError.ts": "618fe5418a462abd2434d9ad36198690ddbb50965f47800aa2833a74d10cf3c2", - "https://deno.land/std@0.51.0/async/mod.ts": "bf46766747775d0fc4070940d20d45fb311c814989485861cdc8a8ef0e3bbbab", + "https://deno.land/x/evt@1.7.9/lib/Evt.factorize.ts": "878e0577d223f3b295b82d8d1d79f988e57f95148de93568ef1da4580aaf7e0f", + "https://raw.githubusercontent.com/garronej/run_exclusive/2.2.4/mod.ts": "1219baae8b08f63804cdb2df9d26936cc7a61194a5d06404cbf38bb4b82e6bec", "https://deno.land/std@0.52.0/io/util.ts": "ae133d310a0fdcf298cea7bc09a599c49acb616d34e148e263bcb02976f80dee", - "https://deno.land/x/evt@v1.6.8/deno_dist/lib/Evt.getCtx.ts": "32a8472d808b74ef51cb9403fee7f6c113830b0bd1ef42965d850bf57c469c19", - "https://raw.githubusercontent.com/garronej/minimal_polyfills/v1.0.8/deno_dist/lib/WeakMap.ts": "3b0cb6ab1348897b5e107e932f53213e1459e9759db0c5eea5d01eb9bd3e0ddb", - "https://deno.land/x/evt@v1.6.8/deno_dist/lib/Evt.from.ts": "a4c87046b730b38ac14d327957d528def6aefa31be972be30845751279dc9f7b", - "https://deno.land/std@0.51.0/http/server.ts": "d2b977c100d830262d8525915c3f676ce33f1e986926a3cdbc81323cf724b599", - "https://deno.land/std@0.52.0/path/_globrex.ts": "a88b9da6a150b8d8e87a7b9eef794f97b10e709910071bb57f8619dd2d0291dc", - "https://deno.land/std@0.51.0/path/_globrex.ts": "a88b9da6a150b8d8e87a7b9eef794f97b10e709910071bb57f8619dd2d0291dc", - "https://deno.land/std@0.52.0/textproto/mod.ts": "aa585cd8dceb14437cf4499d6620c1fe861140ccfe56125eb931db4cfb90c3b2", - "https://deno.land/x/evt@v1.6.8/deno_dist/lib/StatefulEvt.ts": "f505c824a554d79ab450596875cfa6d15625022a98bf28b53c605df59d6714b3", - "https://deno.land/x/evt@v1.6.8/deno_dist/lib/types/lib.dom.ts": "38978a711746f666da1511afb56a64ac36912e1df8662d4ff735c9e37473a579", - "https://deno.land/x/evt@v1.6.8/deno_dist/lib/types/interfaces/CtxLike.ts": "666492e3600aae3ae75ebfafd14816acb87a738b920a45c4ed060cabc12c02c3", - "https://deno.land/std@0.52.0/node/timers.ts": "3d7063ba3b0477c247573c20fe3efc8999a5cee555dbb2cc45cdb06320a907c2", - "https://deno.land/std@0.51.0/datetime/mod.ts": "b533eb7f7627799e5030131ae80dae4d73e100507a3a1fddc1a34be677de7b1b", - "https://deno.land/std@0.52.0/http/server.ts": "d2b977c100d830262d8525915c3f676ce33f1e986926a3cdbc81323cf724b599", - "https://deno.land/std@0.52.0/path/separator.ts": "7bdb45c19c5c934c49c69faae861b592ef17e6699a923449d3eaaf83ec4e7919", - "https://deno.land/x/evt@v1.6.8/deno_dist/tools/typeSafety/index.ts": "77f9d2125366756c0e9f48316f32f72761a5fe24e3c230d8efa64cdb09149b47", - "https://deno.land/x/media_types@v2.3.1/mod.ts": "d8bd0fbb6047902b02ee2f30d1689adbab169893c418639040ef22bfa92e9896", - "https://deno.land/x/evt@v1.6.8/deno_dist/tools/typeSafety/matchVoid.ts": "5b5b8f05957a4aa9638e36e8b7360edb9c69f6bde7de4b81372ecc80512f908f", - "https://deno.land/std@0.51.0/testing/diff.ts": "8f591074fad5d35c0cafa63b1c5334dc3a17d5b934f3b9e07172eed9d5b55553", + "https://deno.land/std@0.51.0/async/delay.ts": "35957d585a6e3dd87706858fb1d6b551cb278271b03f52c5a2cb70e65e00c26a", + "https://raw.githubusercontent.com/garronej/minimal_polyfills/2.1.0/WeakMap.ts": "3b0cb6ab1348897b5e107e932f53213e1459e9759db0c5eea5d01eb9bd3e0ddb", + "https://deno.land/std@0.52.0/io/bufio.ts": "0be99d122e459c0040fbadb5c984935fd12a662c9b8c7fddd1cde4176c6cff27", + "https://deno.land/x/evt@1.7.9/lib/Evt.parsePropsFromArgs.ts": "a27cffc27661016584dbfc6224f0bcdba8c39897c034a932587dead38eb73feb", + "https://deno.land/x/evt@1.7.9/lib/StatefulEvt.ts": "5b19594f118c77f8db06e4eddb6fdea5dc775dfd24262e0dcef889a1ed587c39", + "https://raw.githubusercontent.com/garronej/minimal_polyfills/2.1.0/Set.ts": "2298d1990567c657bdc876a5e5552ad46561b036c2f4b52e901810211b36605f", + "https://deno.land/std@0.51.0/io/bufio.ts": "3dd55426bc8b1e27c7f006847ac0bfefb4c0d5144ba2df2d93944dc37114a6e0", "https://deno.land/std@0.52.0/path/win32.ts": "61248a2b252bb8534f54dafb4546863545e150d2016c74a32e2a4cfb8e061b3f", - "https://deno.land/x/evt@v1.6.8/deno_dist/lib/Evt.parsePropsFromArgs.ts": "a27cffc27661016584dbfc6224f0bcdba8c39897c034a932587dead38eb73feb", - "https://deno.land/std@0.52.0/path/mod.ts": "a789541f8df9170311daa98313c5a76c06b5988f2948647957b3ec6e017d963e", - "https://deno.land/std@0.52.0/http/_io.ts": "025d3735c6b9140fc4bf748bc41dd4e80272de1bc398773ea3e9a8a727cd6032", - "https://deno.land/x/evt@v1.6.8/mod.ts": "d763653d55a63f3d5650b16354149f2235eeda9d822e9008abc79f8a6f7d13af", - "https://deno.land/x/evt@v1.6.8/deno_dist/lib/types/EvtError.ts": "61eb61e75da34ad69c6950dcfb2e5f8760429cb934d5e600c17e8f65188417cf", - "https://deno.land/x/oak@v4.0.0/deps.ts": "13a2453b29497d706b1f148b8653dca92013975f7c99dd41acb0e009084188bf", - "https://deno.land/std@0.51.0/http/http_status.ts": "84ae4289053c4f045cd655fd3b05f33ce62c685bdc0eac2210b12d827ffa7157", - "https://deno.land/std@0.52.0/hash/sha1.ts": "c1a97bde767b98b88495470f39c30c37e44ac3984409f120ef65fd84c9d27608", - "https://deno.land/std@0.52.0/path/_util.ts": "b678a7ecbac6b04c1166832ae54e1024c0431dd2b340b013c46eb2956ab24d4c", - "https://deno.land/x/evt@v1.6.8/deno_dist/lib/Ctx.ts": "428cc1e68e28020d5fd6c52631ab675c29b0d5ae2c857a0056a814de1f6d8d88", + "https://deno.land/std@0.51.0/hash/sha256.ts": "be221d53ae2d1391ed5c47c368bccd0b79582793b2a736ccdcce8b4fc3a5aef5", + "https://deno.land/x/evt@1.7.9/lib/util/compose.ts": "b2ff006b8725190c0df8d0492f6f452eb42aa5f634cf25759b9a5fc81ea56762", + "https://deno.land/x/evt@1.7.9/lib/types/EventTargetLike.ts": "fc235a64cc580ea667ad98ee930a4f9319ba59332e7184e80b327e7ae7bd134a", "https://deno.land/std@0.51.0/path/glob.ts": "ab85e98e4590eae10e561ce8266ad93ebe5af2b68c34dc68b85d9e25bccb4eb7", - "https://deno.land/std@0.51.0/io/bufio.ts": "3dd55426bc8b1e27c7f006847ac0bfefb4c0d5144ba2df2d93944dc37114a6e0", - "https://deno.land/std@0.51.0/fmt/colors.ts": "127ce39ca2ad9714d4ada8d61367f540d76b5b0462263aa839166876b522d3de", - "https://deno.land/x/evt@v1.6.8/deno_dist/lib/index.ts": "0074bc06faf8c9fc6d0218b31cce7dbe3d8f155fdbf44c7e45e75bd6b8e8174e", - "https://deno.land/std@0.52.0/io/bufio.ts": "0be99d122e459c0040fbadb5c984935fd12a662c9b8c7fddd1cde4176c6cff27", - "https://deno.land/x/evt@v1.6.8/deno_dist/tools/typeSafety/assert.ts": "42d43a9d20f33a3363535e02ef5903cf63be70c6b50ce9b25aea8fc6018121cd", - "https://deno.land/x/evt@v1.6.8/deno_dist/lib/Evt.factorize.ts": "878e0577d223f3b295b82d8d1d79f988e57f95148de93568ef1da4580aaf7e0f", - "https://deno.land/x/evt@v1.6.8/deno_dist/lib/util/encapsulateOpState.ts": "d9d74b9b21a2687a7a8aa795764afd85689786ef121d6e1e1648e237edd8b99c", - "https://deno.land/x/evt@v1.6.8/deno_dist/lib/LazyStatefulEvt.ts": "3dbdd8f4641d110fa6123628c8abbddddb6cd44c0613916358736be6650bf7f0", - "https://deno.land/std@0.52.0/path/glob.ts": "ab85e98e4590eae10e561ce8266ad93ebe5af2b68c34dc68b85d9e25bccb4eb7", - "https://raw.githubusercontent.com/garronej/minimal_polyfills/v1.0.8/deno_dist/lib/Map.ts": "23e7bae86df110ad8a68097750530f288c5117fe4c4b30e645b449d20fe156a5", - "https://deno.land/x/evt@v1.6.8/deno_dist/lib/importProxy.ts": "6f57cee2ada724db9575242b44bd7bf598161ea46d8d12e10264fa51a6e7b01f", + "https://deno.land/std@0.51.0/testing/diff.ts": "8f591074fad5d35c0cafa63b1c5334dc3a17d5b934f3b9e07172eed9d5b55553", + "https://deno.land/std@0.52.0/datetime/mod.ts": "b533eb7f7627799e5030131ae80dae4d73e100507a3a1fddc1a34be677de7b1b", "https://deno.land/std@0.51.0/path/separator.ts": "7bdb45c19c5c934c49c69faae861b592ef17e6699a923449d3eaaf83ec4e7919", - "https://deno.land/std@0.51.0/testing/asserts.ts": "213fedbb90a60ae232932c45bd62668f0c5cd17fc0f2a273e96506cba416d181", - "https://deno.land/std@0.51.0/io/util.ts": "ae133d310a0fdcf298cea7bc09a599c49acb616d34e148e263bcb02976f80dee", + "https://deno.land/x/evt@1.7.9/tools/typeSafety/matchVoid.ts": "5b5b8f05957a4aa9638e36e8b7360edb9c69f6bde7de4b81372ecc80512f908f", + "https://deno.land/x/evt@1.7.9/lib/importProxy.ts": "6f57cee2ada724db9575242b44bd7bf598161ea46d8d12e10264fa51a6e7b01f", + "https://deno.land/std@0.52.0/path/_globrex.ts": "a88b9da6a150b8d8e87a7b9eef794f97b10e709910071bb57f8619dd2d0291dc", + "https://deno.land/std@0.52.0/http/server.ts": "d2b977c100d830262d8525915c3f676ce33f1e986926a3cdbc81323cf724b599", + "https://deno.land/std@0.51.0/path/common.ts": "95115757c9dc9e433a641f80ee213553b6752aa6fbb87eb9f16f6045898b6b14", + "https://deno.land/std@0.51.0/async/mod.ts": "bf46766747775d0fc4070940d20d45fb311c814989485861cdc8a8ef0e3bbbab", + "https://deno.land/x/evt@1.7.9/lib/Evt.create.ts": "387388929e07f520386d00b67915bab9b779433950313fb71ebf6b1d424a4ece", + "https://deno.land/x/evt@1.7.9/lib/index.ts": "0074bc06faf8c9fc6d0218b31cce7dbe3d8f155fdbf44c7e45e75bd6b8e8174e", + "https://deno.land/std@0.52.0/fmt/colors.ts": "ec9d653672a9a3c7b6eafe53c5bc797364a2db2dcf766ab649c1155fea7a80b2", + "https://deno.land/x/evt@1.7.9/tools/typeSafety/overwriteReadonlyProp.ts": "02f5fa386e88fae182830b7910b770a746f9baf0f0ce7e5a37e27c0c96990abd", + "https://raw.githubusercontent.com/garronej/run_exclusive/2.2.4/lib/runExclusive.ts": "6376cf9404bfa900daf26ba2a56ddeb18671b8b111ca62b94fec13ad48c8e0a1", + "https://deno.land/std@0.52.0/testing/asserts.ts": "1dc683a61218e2d8c5e9e87e3602a347000288fb207b4d7301414935620e24b3", + "https://raw.githubusercontent.com/garronej/minimal_polyfills/2.1.0/Map.ts": "23e7bae86df110ad8a68097750530f288c5117fe4c4b30e645b449d20fe156a5", + "https://deno.land/x/evt@1.7.9/tools/Deferred.ts": "d7fde0179647da5c3b8f85a1ad316304c2ee63991db22f3421ac3c342a98af10", + "https://raw.githubusercontent.com/garronej/minimal_polyfills/2.1.0/Array.prototype.find.ts": "59e93f4825b13e1d473c6a0548b45c34ce86a008e01d24b7809c8b022527dc9c", + "https://deno.land/std@0.52.0/async/mod.ts": "bf46766747775d0fc4070940d20d45fb311c814989485861cdc8a8ef0e3bbbab", + "https://deno.land/x/evt@1.7.9/lib/Evt.asNonPostable.ts": "b4dbaef2ec42b12716e34499a31c26bb09ade16de405aee6368b6fc004b3f758", + "https://deno.land/std@0.51.0/http/http_status.ts": "84ae4289053c4f045cd655fd3b05f33ce62c685bdc0eac2210b12d827ffa7157", + "https://deno.land/x/evt@1.7.9/lib/types/index.ts": "2f1bdb1e24011cc0ee58f5c2b40b0a4a92ea082873931ad6d391e7899323d8e9", + "https://deno.land/std@0.51.0/http/cookie.ts": "71c7b615837acfa2689e55691e8a1741e27cba9c48239f80bb168d77dcc65801", + "https://deno.land/std@0.52.0/path/common.ts": "95115757c9dc9e433a641f80ee213553b6752aa6fbb87eb9f16f6045898b6b14", + "https://deno.land/x/evt@1.7.9/mod.ts": "a287b21f79647774e5d3c23b5f4a512e74eb6124346bd7f898c8615d2fc23dc1", + "https://deno.land/std@0.51.0/async/mux_async_iterator.ts": "e2a4c2c53aee22374b493b88dfa08ad893bc352c8aeea34f1e543e938ec6ccc6", "https://deno.land/std@0.51.0/bytes/mod.ts": "784b292a65f6879bd39d81cb24590be1140fb4cce74bd4a149f67f2b647ad728", - "https://deno.land/x/evt@v1.6.8/deno_dist/tools/typeSafety/objectKeys.ts": "47e50004c5c50e6c95c950736bcaaee0acf99ef9c08ee97e2f68bc8b7975e9af", - "https://deno.land/x/evt@v1.6.8/deno_dist/tools/typeSafety/overwriteReadonlyProp.ts": "41fa6b2527cbd5e3fed328b56765bf6ed2f07c1a404c18a7b57ea515f1408591", - "https://deno.land/x/evt@v1.6.8/deno_dist/lib/util/genericOperators/throttleTime.ts": "742c8bde694db3032335c21d9152a86c4fcbaad7e0052e2c6752c599ebad8bfd", + "https://deno.land/std@0.52.0/path/mod.ts": "a789541f8df9170311daa98313c5a76c06b5988f2948647957b3ec6e017d963e", + "https://deno.land/x/evt@1.7.9/tools/typeSafety/index.ts": "77f9d2125366756c0e9f48316f32f72761a5fe24e3c230d8efa64cdb09149b47", + "https://deno.land/std@0.51.0/http/server.ts": "d2b977c100d830262d8525915c3f676ce33f1e986926a3cdbc81323cf724b599", + "https://deno.land/std@0.51.0/path/mod.ts": "a789541f8df9170311daa98313c5a76c06b5988f2948647957b3ec6e017d963e", + "https://deno.land/std@0.51.0/http/_io.ts": "025d3735c6b9140fc4bf748bc41dd4e80272de1bc398773ea3e9a8a727cd6032", + "https://deno.land/x/evt@1.7.9/lib/types/interfaces/index.ts": "b0d6ca5b4c508fcf8fcdc372936539d1f4903023813e2fc2ff5b5a82bba97882", "https://deno.land/std@0.51.0/path/_constants.ts": "f6c332625f21d49d5a69414ba0956ac784dbf4b26a278041308e4914ba1c7e2e", - "https://deno.land/std@0.51.0/path/_util.ts": "b678a7ecbac6b04c1166832ae54e1024c0431dd2b340b013c46eb2956ab24d4c", - "https://raw.githubusercontent.com/garronej/minimal_polyfills/v1.0.8/deno_dist/lib/Object.is.ts": "e90029a06fb86dd63e5f6b799d87702b7abe2397a220b78f1cfcce35b922f15a", - "https://deno.land/x/evt@v1.6.8/deno_dist/lib/Evt.asPostable.ts": "0a6db703bf1379ec9cd792db2e23356e6c1555cba85ae568ad4b3a8b59c153cf", - "https://deno.land/x/evt@v1.6.8/deno_dist/lib/types/EventTargetLike.ts": "fc235a64cc580ea667ad98ee930a4f9319ba59332e7184e80b327e7ae7bd134a", - "https://raw.githubusercontent.com/garronej/run_exclusive/v2.1.12/deno_dist/lib/runExclusive.ts": "e2c78d3e45ab2579b01fe6da385b9db0eb15db63f28df2fa7289f82e23ddf45b", - "https://deno.land/std@0.51.0/http/cookie.ts": "71c7b615837acfa2689e55691e8a1741e27cba9c48239f80bb168d77dcc65801", + "https://deno.land/x/evt@1.7.9/tools/typeSafety/typeGuard.ts": "ef91a6cccc54dddbe71339b068f8afea25541d731d8d2c4b72a6109071cbd245", + "https://deno.land/x/evt@1.7.9/tools/typeSafety/defineAccessors.ts": "225826b62d33edf3ca67f65050fba63814d07c17396e65b85baa29ffd3423fd1", + "https://deno.land/std@0.51.0/path/posix.ts": "b742fe902d5d6821c39c02319eb32fc5a92b4d4424b533c47f1a50610afbf381", + "https://deno.land/std@0.51.0/async/deferred.ts": "ac95025f46580cf5197928ba90995d87f26e202c19ad961bc4e3177310894cdc", + "https://deno.land/x/evt@1.7.9/lib/types/Operator.ts": "384bd0410ca2ed861a883619926b6cad4b58c9159b148348641bfc9baba6f57b", + "https://deno.land/x/evt@1.7.9/lib/types/lib.dom.ts": "38978a711746f666da1511afb56a64ac36912e1df8662d4ff735c9e37473a579", "https://deno.land/std@0.52.0/path/_constants.ts": "f6c332625f21d49d5a69414ba0956ac784dbf4b26a278041308e4914ba1c7e2e", - "https://deno.land/std@0.52.0/async/delay.ts": "35957d585a6e3dd87706858fb1d6b551cb278271b03f52c5a2cb70e65e00c26a", - "https://deno.land/std@0.52.0/bytes/mod.ts": "5ad1325fc232f19b59fefbded30013b4bcd39fee4cf1eee73d6a6915ae46bdcd", "https://deno.land/std@0.52.0/path/interface.ts": "89f6e68b0e3bba1401a740c8d688290957de028ed86f95eafe76fe93790ae450", - "https://deno.land/std@0.52.0/http/http_status.ts": "84ae4289053c4f045cd655fd3b05f33ce62c685bdc0eac2210b12d827ffa7157", - "https://deno.land/x/evt@v1.6.8/deno_dist/lib/Evt.merge.ts": "8721642afb4dbad7c701a4ef061f9089694e44476b92d4b9972300c0f1a06829", - "https://deno.land/x/evt@v1.6.8/deno_dist/lib/Evt.useEffect.ts": "da14d655107d4f9b5757281fbbddebc4ee1615d8113e44bc6645b8079de23ee2", - "https://deno.land/std@0.52.0/testing/diff.ts": "8f591074fad5d35c0cafa63b1c5334dc3a17d5b934f3b9e07172eed9d5b55553", + "https://deno.land/x/oak@v4.0.0/types.ts": "41b6c1b6c1735ddced291152108e3173d55db7f6ce893ae97533240ef6b8e74e", + "https://deno.land/x/evt@1.7.9/lib/util/index.ts": "6dfdfc04d8a57ab74add8c57b9265c85dbdce3a8e36b908c2ddb35fa50193ea6", + "https://deno.land/x/evt@1.7.9/lib/util/genericOperators/index.ts": "af1fa4c0388fbd3a90c78ed60b78c025ae7ffea6f2592e7821e852b715070c99", + "https://deno.land/x/evt@1.7.9/lib/Evt.ts": "6dcb5c894709d7d7c23b210df5e30b23a8796b94c3b7c9b873ff906d6ae45a2b", + "https://deno.land/std@0.52.0/node/timers.ts": "3d7063ba3b0477c247573c20fe3efc8999a5cee555dbb2cc45cdb06320a907c2", + "https://deno.land/x/evt@1.7.9/lib/util/genericOperators/to.ts": "9f1aa067e713d7ba85d095bbdcfe29191138d138baaad2c0db80fc051b81d282", + "https://deno.land/x/evt@1.7.9/tools/typeSafety/assert.ts": "42d43a9d20f33a3363535e02ef5903cf63be70c6b50ce9b25aea8fc6018121cd", + "https://deno.land/x/media_types@v2.3.1/db.ts": "ecbb836ceadc885e53192a9923f054ac2417cbdb1892edf960fd328b1be3f665", + "https://deno.land/std@0.52.0/async/deferred.ts": "ac95025f46580cf5197928ba90995d87f26e202c19ad961bc4e3177310894cdc", + "https://deno.land/x/oak@v4.0.0/deps.ts": "13a2453b29497d706b1f148b8653dca92013975f7c99dd41acb0e009084188bf", + "https://deno.land/std@0.51.0/path/interface.ts": "89f6e68b0e3bba1401a740c8d688290957de028ed86f95eafe76fe93790ae450", + "https://deno.land/std@0.52.0/path/_util.ts": "b678a7ecbac6b04c1166832ae54e1024c0431dd2b340b013c46eb2956ab24d4c", "https://deno.land/std@0.52.0/encoding/utf8.ts": "8654fa820aa69a37ec5eb11908e20b39d056c9bf1c23ab294303ff467f3d50a1", - "https://deno.land/x/evt@v1.6.8/deno_dist/lib/util/genericOperators/index.ts": "af1fa4c0388fbd3a90c78ed60b78c025ae7ffea6f2592e7821e852b715070c99", - "https://deno.land/x/evt@v1.6.8/deno_dist/lib/LazyEvt.ts": "ecc6b67ecdf05aeebd9f65aa4685688e81dfc458abc7d488f09290319bd58f07", + "https://deno.land/x/media_types@v2.3.1/deps.ts": "02a37b0bef1e1aed7afcac7fd482aecd2598722914239ff5ca1cae0a8b7cd2ca", + "https://deno.land/x/evt@1.7.9/lib/LazyEvt.ts": "ecc6b67ecdf05aeebd9f65aa4685688e81dfc458abc7d488f09290319bd58f07", + "https://deno.land/x/evt@1.7.9/lib/util/encapsulateOpState.ts": "d9d74b9b21a2687a7a8aa795764afd85689786ef121d6e1e1648e237edd8b99c", + "https://deno.land/std@0.51.0/encoding/utf8.ts": "8654fa820aa69a37ec5eb11908e20b39d056c9bf1c23ab294303ff467f3d50a1", + "https://deno.land/std@0.51.0/datetime/mod.ts": "b533eb7f7627799e5030131ae80dae4d73e100507a3a1fddc1a34be677de7b1b", + "https://deno.land/x/evt@1.7.9/tools/typeSafety/id.ts": "5e4b76ff7cb41641224adc8d2d94de8dcdaefd122f686944910e8656d244519c", "https://deno.land/std@0.51.0/textproto/mod.ts": "3118d7a42c03c242c5a49c2ad91c8396110e14acca1324e7aaefd31a999b71a4", - "https://deno.land/std@0.51.0/hash/sha256.ts": "be221d53ae2d1391ed5c47c368bccd0b79582793b2a736ccdcce8b4fc3a5aef5", - "https://deno.land/x/evt@v1.6.8/deno_dist/lib/Evt.asNonPostable.ts": "b4dbaef2ec42b12716e34499a31c26bb09ade16de405aee6368b6fc004b3f758", - "https://deno.land/x/evt@v1.6.8/deno_dist/tools/typeSafety/exclude.ts": "49a66cf27578c7c9e92b9e841d3229e62962b20b0bd81458e45c282f3db519df", - "https://deno.land/std@0.51.0/http/_io.ts": "025d3735c6b9140fc4bf748bc41dd4e80272de1bc398773ea3e9a8a727cd6032", - "https://deno.land/x/evt@v1.6.8/deno_dist/lib/types/index.ts": "2f1bdb1e24011cc0ee58f5c2b40b0a4a92ea082873931ad6d391e7899323d8e9", + "https://deno.land/std@0.51.0/path/_util.ts": "b678a7ecbac6b04c1166832ae54e1024c0431dd2b340b013c46eb2956ab24d4c", + "https://deno.land/x/evt@1.7.9/lib/util/genericOperators/throttleTime.ts": "742c8bde694db3032335c21d9152a86c4fcbaad7e0052e2c6752c599ebad8bfd", + "https://deno.land/x/evt@1.7.9/lib/types/helper/index.ts": "c6177abf99ec1f7ced101b5ddbd551797809f04e72ebf2f2d203e76c521ebd6b", + "https://deno.land/std@0.52.0/hash/sha1.ts": "c1a97bde767b98b88495470f39c30c37e44ac3984409f120ef65fd84c9d27608", + "https://deno.land/std@0.52.0/path/separator.ts": "7bdb45c19c5c934c49c69faae861b592ef17e6699a923449d3eaaf83ec4e7919", "https://deno.land/std@0.52.0/async/mux_async_iterator.ts": "e2a4c2c53aee22374b493b88dfa08ad893bc352c8aeea34f1e543e938ec6ccc6", - "https://deno.land/std@0.52.0/path/posix.ts": "b742fe902d5d6821c39c02319eb32fc5a92b4d4424b533c47f1a50610afbf381", - "https://deno.land/std@0.51.0/path/mod.ts": "a789541f8df9170311daa98313c5a76c06b5988f2948647957b3ec6e017d963e", - "https://deno.land/std@0.51.0/encoding/utf8.ts": "8654fa820aa69a37ec5eb11908e20b39d056c9bf1c23ab294303ff467f3d50a1", - "https://deno.land/std@0.51.0/path/posix.ts": "b742fe902d5d6821c39c02319eb32fc5a92b4d4424b533c47f1a50610afbf381", - "https://deno.land/x/evt@v1.6.8/deno_dist/tools/typeSafety/id.ts": "5e4b76ff7cb41641224adc8d2d94de8dcdaefd122f686944910e8656d244519c", - "https://deno.land/std@0.52.0/datetime/mod.ts": "b533eb7f7627799e5030131ae80dae4d73e100507a3a1fddc1a34be677de7b1b", - "https://deno.land/x/evt@v1.6.8/deno_dist/lib/util/index.ts": "6dfdfc04d8a57ab74add8c57b9265c85dbdce3a8e36b908c2ddb35fa50193ea6", - "https://deno.land/x/oak@v4.0.0/types.ts": "41b6c1b6c1735ddced291152108e3173d55db7f6ce893ae97533240ef6b8e74e", - "https://raw.githubusercontent.com/garronej/minimal_polyfills/v1.0.8/deno_dist/lib/Set.ts": "2298d1990567c657bdc876a5e5552ad46561b036c2f4b52e901810211b36605f", - "https://deno.land/std@0.51.0/path/interface.ts": "89f6e68b0e3bba1401a740c8d688290957de028ed86f95eafe76fe93790ae450", - "https://deno.land/std@0.52.0/async/mod.ts": "bf46766747775d0fc4070940d20d45fb311c814989485861cdc8a8ef0e3bbbab", - "https://deno.land/std@0.52.0/testing/asserts.ts": "1dc683a61218e2d8c5e9e87e3602a347000288fb207b4d7301414935620e24b3", - "https://deno.land/std@0.51.0/path/win32.ts": "61248a2b252bb8534f54dafb4546863545e150d2016c74a32e2a4cfb8e061b3f", "https://deno.land/std@0.52.0/http/cookie.ts": "948e9066409bdd78b1ce99774e8254cddcd41c6b8fd5ac80183e3928e2777d15", - "https://deno.land/x/evt@v1.6.8/deno_dist/lib/util/invokeOperator.ts": "072a981806d2814d03f445c3b186b1612926553db08cadba3cf08131ca809f07", - "https://deno.land/x/evt@v1.6.8/deno_dist/lib/types/Operator.ts": "384bd0410ca2ed861a883619926b6cad4b58c9159b148348641bfc9baba6f57b", - "https://deno.land/std@0.52.0/async/deferred.ts": "ac95025f46580cf5197928ba90995d87f26e202c19ad961bc4e3177310894cdc", - "https://deno.land/x/evt@v1.6.8/deno_dist/tools/typeSafety/defineAccessors.ts": "7fa83102b445c1e13f5696593e1bb270496fac879cfb1896e763409b8f933ed2", - "https://deno.land/x/evt@v1.6.8/deno_dist/tools/typeSafety/typeGuard.ts": "ef91a6cccc54dddbe71339b068f8afea25541d731d8d2c4b72a6109071cbd245", - "https://deno.land/x/evt@v1.6.8/deno_dist/lib/Evt.create.ts": "387388929e07f520386d00b67915bab9b779433950313fb71ebf6b1d424a4ece", - "https://raw.githubusercontent.com/garronej/minimal_polyfills/v1.0.8/deno_dist/lib/Array.prototype.find.ts": "59e93f4825b13e1d473c6a0548b45c34ce86a008e01d24b7809c8b022527dc9c", - "https://deno.land/x/evt@v1.6.8/deno_dist/lib/Evt.loosenType.ts": "a43aaa204e80db39a0d1008e1fa0b1d159a66509787dcd046cc9f53a4255b4a7", - "https://deno.land/x/evt@v1.6.8/deno_dist/lib/types/interfaces/index.ts": "b0d6ca5b4c508fcf8fcdc372936539d1f4903023813e2fc2ff5b5a82bba97882", - "https://deno.land/std@0.52.0/fmt/colors.ts": "ec9d653672a9a3c7b6eafe53c5bc797364a2db2dcf766ab649c1155fea7a80b2", - "https://deno.land/std@0.51.0/async/mux_async_iterator.ts": "e2a4c2c53aee22374b493b88dfa08ad893bc352c8aeea34f1e543e938ec6ccc6", - "https://deno.land/x/media_types@v2.3.1/db.ts": "ecbb836ceadc885e53192a9923f054ac2417cbdb1892edf960fd328b1be3f665", - "https://deno.land/std@0.51.0/path/common.ts": "95115757c9dc9e433a641f80ee213553b6752aa6fbb87eb9f16f6045898b6b14", - "https://deno.land/std@0.51.0/async/deferred.ts": "ac95025f46580cf5197928ba90995d87f26e202c19ad961bc4e3177310894cdc", - "https://deno.land/x/evt@v1.6.8/deno_dist/lib/util/genericOperators/to.ts": "9f1aa067e713d7ba85d095bbdcfe29191138d138baaad2c0db80fc051b81d282", - "https://deno.land/std@0.51.0/async/delay.ts": "35957d585a6e3dd87706858fb1d6b551cb278271b03f52c5a2cb70e65e00c26a" + "https://deno.land/std@0.52.0/testing/diff.ts": "8f591074fad5d35c0cafa63b1c5334dc3a17d5b934f3b9e07172eed9d5b55553", + "https://deno.land/x/evt@1.7.9/lib/Evt.from.ts": "a4c87046b730b38ac14d327957d528def6aefa31be972be30845751279dc9f7b", + "https://deno.land/x/evt@1.7.9/lib/Evt.newCtx.ts": "3e5e660eacb5af62b0e585a2206d06e5ed4680dadf198f8dcc569d52452f59a4", + "https://deno.land/std@0.51.0/fmt/colors.ts": "127ce39ca2ad9714d4ada8d61367f540d76b5b0462263aa839166876b522d3de", + "https://deno.land/x/evt@1.7.9/lib/Evt.asPostable.ts": "0a6db703bf1379ec9cd792db2e23356e6c1555cba85ae568ad4b3a8b59c153cf", + "https://deno.land/x/evt@1.7.9/lib/Evt.merge.ts": "8721642afb4dbad7c701a4ef061f9089694e44476b92d4b9972300c0f1a06829", + "https://deno.land/std@0.51.0/path/win32.ts": "61248a2b252bb8534f54dafb4546863545e150d2016c74a32e2a4cfb8e061b3f", + "https://deno.land/std@0.52.0/bytes/mod.ts": "5ad1325fc232f19b59fefbded30013b4bcd39fee4cf1eee73d6a6915ae46bdcd", + "https://deno.land/std@0.51.0/io/util.ts": "ae133d310a0fdcf298cea7bc09a599c49acb616d34e148e263bcb02976f80dee", + "https://deno.land/std@0.52.0/path/glob.ts": "ab85e98e4590eae10e561ce8266ad93ebe5af2b68c34dc68b85d9e25bccb4eb7", + "https://deno.land/std@0.52.0/path/posix.ts": "b742fe902d5d6821c39c02319eb32fc5a92b4d4424b533c47f1a50610afbf381", + "https://deno.land/x/evt@1.7.9/lib/LazyStatefulEvt.ts": "3dbdd8f4641d110fa6123628c8abbddddb6cd44c0613916358736be6650bf7f0", + "https://deno.land/x/evt@1.7.9/tools/typeSafety/exclude.ts": "49a66cf27578c7c9e92b9e841d3229e62962b20b0bd81458e45c282f3db519df", + "https://deno.land/x/evt@1.7.9/lib/util/invokeOperator.ts": "072a981806d2814d03f445c3b186b1612926553db08cadba3cf08131ca809f07", + "https://deno.land/std@0.52.0/textproto/mod.ts": "aa585cd8dceb14437cf4499d6620c1fe861140ccfe56125eb931db4cfb90c3b2", + "https://deno.land/x/evt@1.7.9/lib/Evt.useEffect.ts": "da14d655107d4f9b5757281fbbddebc4ee1615d8113e44bc6645b8079de23ee2", + "https://deno.land/std@0.51.0/path/_globrex.ts": "a88b9da6a150b8d8e87a7b9eef794f97b10e709910071bb57f8619dd2d0291dc", + "https://deno.land/x/evt@1.7.9/lib/types/interfaces/CtxLike.ts": "666492e3600aae3ae75ebfafd14816acb87a738b920a45c4ed060cabc12c02c3", + "https://deno.land/x/evt@1.7.9/lib/Ctx.ts": "33032a434e595e67f9b570403738a77e0c097cf59b77fc3c9d35a90f1f74230d", + "https://deno.land/x/evt@1.7.9/tools/typeSafety/objectKeys.ts": "47e50004c5c50e6c95c950736bcaaee0acf99ef9c08ee97e2f68bc8b7975e9af", + "https://deno.land/x/evt@1.7.9/lib/Evt.getCtx.ts": "9d49747a2ef5a98a9f8e2c48c1d0ec026bdd06e02cf9a1156f89870535f77df3", + "https://deno.land/std@0.51.0/testing/asserts.ts": "213fedbb90a60ae232932c45bd62668f0c5cd17fc0f2a273e96506cba416d181", + "https://deno.land/std@0.52.0/http/http_status.ts": "84ae4289053c4f045cd655fd3b05f33ce62c685bdc0eac2210b12d827ffa7157", + "https://deno.land/x/evt@1.7.9/lib/types/EvtError.ts": "61eb61e75da34ad69c6950dcfb2e5f8760429cb934d5e600c17e8f65188417cf", + "https://deno.land/x/evt@1.7.9/lib/Evt.loosenType.ts": "a43aaa204e80db39a0d1008e1fa0b1d159a66509787dcd046cc9f53a4255b4a7", + "https://deno.land/std@0.52.0/http/_io.ts": "025d3735c6b9140fc4bf748bc41dd4e80272de1bc398773ea3e9a8a727cd6032", + "https://deno.land/std@0.52.0/async/delay.ts": "35957d585a6e3dd87706858fb1d6b551cb278271b03f52c5a2cb70e65e00c26a", + "https://deno.land/x/oak@v4.0.0/httpError.ts": "618fe5418a462abd2434d9ad36198690ddbb50965f47800aa2833a74d10cf3c2", + "https://deno.land/x/media_types@v2.3.1/mod.ts": "d8bd0fbb6047902b02ee2f30d1689adbab169893c418639040ef22bfa92e9896", + "https://raw.githubusercontent.com/garronej/minimal_polyfills/2.1.0/Object.is.ts": "e90029a06fb86dd63e5f6b799d87702b7abe2397a220b78f1cfcce35b922f15a" } \ No newline at end of file diff --git a/mod.ts b/mod.ts index ca120ec7..d064888d 100644 --- a/mod.ts +++ b/mod.ts @@ -13,4 +13,4 @@ export { json } from "./src/middleware/bodyParser/json.ts"; export { raw } from "./src/middleware/bodyParser/raw.ts"; export { text } from "./src/middleware/bodyParser/text.ts"; export { urlencoded } from "./src/middleware/bodyParser/urlencoded.ts"; -export { VERSION, DENO_SUPPORTED_VERSION } from "./version.ts"; +export { VERSION, DENO_SUPPORTED_VERSIONS } from "./version.ts"; diff --git a/version.ts b/version.ts index 57040ad4..6e0d4cba 100644 --- a/version.ts +++ b/version.ts @@ -1,9 +1,9 @@ /** * Version of Opine. */ -export const VERSION: string = "0.2.0"; +export const VERSION: string = "0.3.0"; /** * Supported version of Deno. */ -export const DENO_SUPPORTED_VERSION: string = "1.0.0"; +export const DENO_SUPPORTED_VERSIONS: string[] = ["1.0.0", "1.0.2"];