Skip to content

Commit

Permalink
feat: 1.5.0
Browse files Browse the repository at this point in the history
  • Loading branch information
cmorten committed Jun 19, 2021
1 parent c8932e8 commit cf17f37
Show file tree
Hide file tree
Showing 10 changed files with 30 additions and 24 deletions.
12 changes: 6 additions & 6 deletions .github/API/application.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ Adapted from the [ExpressJS API Docs](https://expressjs.com/en/4x/api.html).
The `app` object conventionally denotes the Opine application. Create it by calling the top-level `opine()` function exported by the Opine module:

```ts
import opine from "https://deno.land/x/opine@1.4.0/mod.ts";
import opine from "https://deno.land/x/opine@1.5.0/mod.ts";

const app = opine();

Expand Down Expand Up @@ -59,7 +59,7 @@ The `app.mountpath` property contains one or more path patterns on which a sub-a
> A sub-app is an instance of `opine` that may be used for handling the request to a route.
```ts
import opine from "https://deno.land/x/opine@1.4.0/mod.ts";
import opine from "https://deno.land/x/opine@1.5.0/mod.ts";

const app = opine(); // the main app
const admin = opine(); // the sub app
Expand Down Expand Up @@ -447,7 +447,7 @@ app.get("/", function (req, res) {
Binds and listens for connections on the specified address. This method is nearly identical to Deno's [http.listenAndServe()](https://doc.deno.land/https/deno.land/std/http/server.ts#listenAndServe). An optional callback can be provided which will be executed after the server starts listening for requests - this is provided for legacy reasons to aid in transitions from Express on Node.

```ts
import opine from "https://deno.land/x/opine@1.4.0/mod.ts";
import opine from "https://deno.land/x/opine@1.5.0/mod.ts";

const app = opine();

Expand Down Expand Up @@ -477,7 +477,7 @@ Binds and listens for connections on the specified numerical port. If no port is
This method is supported for legacy reasons to aid in transitions from Express on Node.

```ts
import opine from "https://deno.land/x/opine@1.4.0/mod.ts";
import opine from "https://deno.land/x/opine@1.5.0/mod.ts";

const app = opine();
const PORT = 3000;
Expand All @@ -490,7 +490,7 @@ app.listen(PORT, () => console.log(`Server started on port ${PORT}`));
Binds and listens for connections using the specified [http.HTTPOptions](https://doc.deno.land/https/deno.land/std/http/server.ts#HTTPOptions). This method is nearly identical to Deno's [http.listenAndServe()](https://doc.deno.land/https/deno.land/std/http/server.ts#listenAndServe). An optional callback can be provided which will be executed after the server starts listening for requests - this is provided for legacy reasons to aid in transitions from Express on Node.

```ts
import opine from "https://deno.land/x/opine@1.4.0/mod.ts";
import opine from "https://deno.land/x/opine@1.5.0/mod.ts";

const app = opine();

Expand All @@ -502,7 +502,7 @@ app.listen({ port: 3000 });
Binds and listens for connections using the specified [http.HTTPSOptions](https://doc.deno.land/https/deno.land/std/http/server.ts#HTTPSOptions). This method is nearly identical to Deno's [http.listenAndServeTLS()](https://doc.deno.land/https/deno.land/std/http/server.ts#listenAndServeTLS). An optional callback can be provided which will be executed after the server starts listening for requests - this is provided for legacy reasons to aid in transitions from Express on Node.

```ts
import opine from "https://deno.land/x/opine@1.4.0/mod.ts";
import opine from "https://deno.land/x/opine@1.5.0/mod.ts";

const app = opine();

Expand Down
8 changes: 4 additions & 4 deletions .github/API/middlewares.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ After the middleware, the existing `body` property on the `request` object (i.e.
> As `req.body` and `req.parsedBody` shapes are based on user-controlled input, all properties and values in this object are untrusted and should be validated before trusting. For example, `req.body.foo.toString()` may fail in multiple ways, for example `foo` may not be there or may not be a string, and `toString` may not be a function and instead a string or other user-input.
```ts
import { opine, json } from "https://deno.land/x/opine@1.4.0/mod.ts";
import { opine, json } from "https://deno.land/x/opine@1.5.0/mod.ts";

const app = opine();

Expand Down Expand Up @@ -47,7 +47,7 @@ After the middleware, the existing `body` property on the `request` object (i.e.
> As `req.body` and `req.parsedBody` shapes are based on user-controlled input, all properties and values in this object are untrusted and should be validated before trusting. For example, `req.body.toString()` may fail in multiple ways, for example stacking multiple parsers `req.body` may be from a different parser. Testing that `req.body` is a string before calling string methods is recommended.
```ts
import { opine, raw } from "https://deno.land/x/opine@1.4.0/mod.ts";
import { opine, raw } from "https://deno.land/x/opine@1.5.0/mod.ts";

const app = opine();

Expand Down Expand Up @@ -166,7 +166,7 @@ After the middleware, the existing `body` property on the `request` object (i.e.
> As `req.body` and `req.parsedBody` shapes are based on user-controlled input, all properties and values in this object are untrusted and should be validated before trusting. For example, `req.body.trim()` may fail in multiple ways, for example stacking multiple parsers `req.body` may be from a different parser. Testing that `req.parsedBody` is a string before calling string methods is recommended.
```ts
import { opine, text } from "https://deno.land/x/opine@1.4.0/mod.ts";
import { opine, text } from "https://deno.land/x/opine@1.5.0/mod.ts";

const app = opine();

Expand Down Expand Up @@ -198,7 +198,7 @@ After the middleware, the existing `body` property on the `request` object (i.e.
> As `req.body` and `req.parsedBody` shapes are based on user-controlled input, all properties and values in this object are untrusted and should be validated before trusting. For example, `req.body.foo.toString()` may fail in multiple ways, for example `foo` may not be there or may not be a string, and `toString` may not be a function and instead a string or other user-input.
```ts
import { opine, urlencoded } from "https://deno.land/x/opine@1.4.0/mod.ts";
import { opine, urlencoded } from "https://deno.land/x/opine@1.5.0/mod.ts";

const app = opine();

Expand Down
4 changes: 2 additions & 2 deletions .github/API/opine.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,15 @@ Adapted from the [ExpressJS API Docs](https://expressjs.com/en/4x/api.html).
Creates an Opine application. The `opine()` function is a top-level function exported by the Opine module:

```ts
import opine from "https://deno.land/x/opine@1.4.0/mod.ts";
import opine from "https://deno.land/x/opine@1.5.0/mod.ts";

const app = opine();
```

The `opine()` function is also exported as a named export:

```ts
import { opine } from "https://deno.land/x/opine@1.4.0/mod.ts";
import { opine } from "https://deno.land/x/opine@1.5.0/mod.ts";

const app = opine();
```
4 changes: 2 additions & 2 deletions .github/API/request.md
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ import {
opine,
json,
urlencoded,
} from "https://deno.land/x/opine@1.4.0/mod.ts";
} from "https://deno.land/x/opine@1.5.0/mod.ts";

const app = opine();

Expand All @@ -100,7 +100,7 @@ app.post("/profile", function (req, res, next) {
The following example shows how to implement your own simple body-parsing middleware to transform `req.body` into a raw string:

```ts
import opine from "https://deno.land/x/opine@1.4.0/mod.ts";
import opine from "https://deno.land/x/opine@1.5.0/mod.ts";

const app = opine();

Expand Down
4 changes: 2 additions & 2 deletions .github/API/router.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ A router behaves like middleware itself, so you can use it as an argument to [ap
Opine has a top-level named function export `Router()` that creates a new `router` object.

```ts
import { Router } from "https://deno.land/x/opine@1.4.0/mod.ts";
import { Router } from "https://deno.land/x/opine@1.5.0/mod.ts";

const router = Router(options);
```
Expand Down Expand Up @@ -210,7 +210,7 @@ This method is similar to [app.use()](./application#appusepath-callback--callbac
Middleware is like a plumbing pipe: requests start at the first middleware function defined and work their way "down" the middleware stack processing for each path they match.

```ts
import opine, { Router } from "https://deno.land/x/opine@1.4.0/mod.ts";
import opine, { Router } from "https://deno.land/x/opine@1.5.0/mod.ts";

const app = opine();
const router = Router();
Expand Down
6 changes: 6 additions & 0 deletions .github/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# ChangeLog

## [1.5.0] - 19-06-2021

- [NO-ISSUE] Support Deno 1.11.1 and std 0.99.0 (#131)
- [#128] add res.removeHeader (#129)
- [#126] add setHeader alias for res.set (#127)

## [1.4.0] - 22-05-2021

- feat: support Deno `1.10.2` and std `0.97.0`
Expand Down
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ Fast, minimalist web framework for <a href="https://deno.land/">Deno</a> ported
## Getting Started

```ts
import { opine } from "https://deno.land/x/opine@1.4.0/mod.ts";
import { opine } from "https://deno.land/x/opine@1.5.0/mod.ts";

const app = opine();

Expand All @@ -61,13 +61,13 @@ Before importing, [download and install Deno](https://deno.land/#installation).
You can then import Opine straight into your project:

```ts
import { opine } from "https://deno.land/x/opine@1.4.0/mod.ts";
import { opine } from "https://deno.land/x/opine@1.5.0/mod.ts";
```

Opine is also available on [nest.land](https://nest.land/package/opine), a package registry for Deno on the Blockchain.

```ts
import { opine } from "https://x.nest.land/opine@1.4.0/mod.ts";
import { opine } from "https://x.nest.land/opine@1.5.0/mod.ts";
```

## Features
Expand Down
6 changes: 3 additions & 3 deletions docs/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ <h2>Table of Contents</h2>
<a href="#getting-started" id="getting-started" style="color: inherit; text-decoration: none;">
<h2>Getting Started</h2>
</a>
<pre><code class="language-ts"><span class="hljs-keyword">import</span> { opine } <span class="hljs-keyword">from</span> <span class="hljs-string">&quot;https://deno.land/x/opine@1.4.0/mod.ts&quot;</span>;
<pre><code class="language-ts"><span class="hljs-keyword">import</span> { opine } <span class="hljs-keyword">from</span> <span class="hljs-string">&quot;https://deno.land/x/opine@1.5.0/mod.ts&quot;</span>;

<span class="hljs-keyword">const</span> app = opine();

Expand All @@ -121,10 +121,10 @@ <h2>Installation</h2>
<p>This is a <a href="https://deno.land/">Deno</a> module available to import direct from this repo and via the <a href="https://deno.land/x">Deno Registry</a>.</p>
<p>Before importing, <a href="https://deno.land/#installation">download and install Deno</a>.</p>
<p>You can then import Opine straight into your project:</p>
<pre><code class="language-ts"><span class="hljs-keyword">import</span> { opine } <span class="hljs-keyword">from</span> <span class="hljs-string">&quot;https://deno.land/x/opine@1.4.0/mod.ts&quot;</span>;
<pre><code class="language-ts"><span class="hljs-keyword">import</span> { opine } <span class="hljs-keyword">from</span> <span class="hljs-string">&quot;https://deno.land/x/opine@1.5.0/mod.ts&quot;</span>;
</code></pre>
<p>Opine is also available on <a href="https://nest.land/package/opine">nest.land</a>, a package registry for Deno on the Blockchain.</p>
<pre><code class="language-ts"><span class="hljs-keyword">import</span> { opine } <span class="hljs-keyword">from</span> <span class="hljs-string">&quot;https://x.nest.land/opine@1.4.0/mod.ts&quot;</span>;
<pre><code class="language-ts"><span class="hljs-keyword">import</span> { opine } <span class="hljs-keyword">from</span> <span class="hljs-string">&quot;https://x.nest.land/opine@1.5.0/mod.ts&quot;</span>;
</code></pre>
<a href="#features" id="features" style="color: inherit; text-decoration: none;">
<h2>Features</h2>
Expand Down
2 changes: 1 addition & 1 deletion egg.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "opine",
"description": "Fast, minimalist web framework for Deno ported from ExpressJS.",
"version": "1.4.0",
"version": "1.5.0",
"repository": "https://github.com/asos-craigmorten/opine",
"stable": true,
"checkFormat": false,
Expand Down
2 changes: 1 addition & 1 deletion version.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/**
* Version of Opine.
*/
export const VERSION = "1.4.0";
export const VERSION = "1.5.0";

/**
* Supported version of Deno.
Expand Down

0 comments on commit cf17f37

Please sign in to comment.