Skip to content
This repository has been archived by the owner on Jun 27, 2023. It is now read-only.

Releases: reno-router/reno

Migrates to jspm for Sinon in order to resolve #1

01 Jun 16:18
Compare
Choose a tag to compare
v1.0.0-alpha.2

Migrates to jspm for Sinon in order to resolve #1

First alpha of 1.0.0! 🎉

15 May 22:13
Compare
Choose a tag to compare

Supports Deno 1.0.0.

Breaking changes

  • withJsonBody() and withFormBody() higher-order handlers will now throw an error if the Content-Length header is not set (usually occurs when the expected request body is missing), which is required since internally migrating to BufReader to convert request bodies to strings

Updates Deno version to v0.31.0

25 Jan 16:24
Compare
Choose a tag to compare

Just some housekeeping to ensure Reno supports the latest release of Deno.

Resolves null iteration bug in route lookup

26 Nov 15:55
Compare
Choose a tag to compare

Provides a fallback array for url.pathname.match() in route lookup, and validates by consuming actual path parser implementation in the router's unit tests.

Pulls Sinon type def as remote import

26 Nov 15:36
Compare
Choose a tag to compare

This was resulting in a broken fetch for consuming projects.

Fixes a router lookup bug

20 Nov 14:13
Compare
Choose a tag to compare
v0.6.2

Moves current README to template so version numbers are injectable

Allows pipe transform return to be optional

19 Nov 12:11
Compare
Choose a tag to compare

This avoids redundantly returning the received response from a pipe transformation when mutating said response:

const withCaching = pipe(
  (req, res) => {
    res.headers.append("Cache-Control", "max-age=86400");
    // no return statement required
  }
);

Adds pipe() for creating reusable route logic

18 Nov 19:20
Compare
Choose a tag to compare

Adds pipe() for creating reusable route logic. It's conceptually similar to Express' middleware pattern, but leverages function piping to create reusable, higher-order route handlers:

import { createRouteMap, jsonResponse, pipe } from "https://raw.githubusercontent.com/jamesseanwright/reno/v0.6.0/reno/mod.ts";

const withCaching = pipe(
  (req, res) => {
    res.headers.append("Cache-Control", "max-age=86400");
    return res;
  },
  (req, res) => ({
    ...res,
    cookies: new Map<string, string>([["requested_proto", req.proto]])
  })
);

const home = withCaching(() =>
  jsonResponse({
    foo: "bar",
    isLol: true
  })
);

export const routes = createRouteMap([["/", home]]);

Updates Content-Type header ordering in response helpers

17 Nov 21:49
Compare
Choose a tag to compare

Any Content-Header value specified when calling textResponse or jsonResponse will override the default value.

Abstracts RouteMap constructor with createRouteMap export

17 Nov 21:11
Compare
Choose a tag to compare

See README example for new route map contract.