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

Commit

Permalink
Generates README
Browse files Browse the repository at this point in the history
  • Loading branch information
jamesseanwright committed Sep 4, 2020
1 parent 159e121 commit ba9d79a
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
12 changes: 6 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

[![Build Status](https://travis-ci.org/reno-router/reno.svg?branch=master)](https://travis-ci.org/reno-router/reno)

[![deno doc](https://doc.deno.land/badge.svg)](https://doc.deno.land/https/deno.land/x/[email protected].0/reno/mod.ts)
[![deno doc](https://doc.deno.land/badge.svg)](https://doc.deno.land/https/deno.land/x/[email protected].1/reno/mod.ts)

Reno is a thin routing library designed to sit on top of [Deno](https://deno.land/)'s [standard HTTP module](https://github.com/denoland/deno/tree/master/std/http).

Expand All @@ -27,7 +27,7 @@ import {
textResponse,
jsonResponse,
streamResponse,
} from "https://deno.land/x/[email protected].0/reno/mod.ts";
} from "https://deno.land/x/[email protected].1/reno/mod.ts";

export const routes = createRouteMap([
["/home", () => textResponse("Hello world!")],
Expand Down Expand Up @@ -81,7 +81,7 @@ const router = createRouter(routes);
This, along with request handlers being [pure functions](https://en.wikipedia.org/wiki/Pure_function), makes unit testing Reno services a breeze:

```ts
import { jsonResponse, assertResponsesAreEqual } from "https://deno.land/x/[email protected].0/reno/mod.ts";
import { jsonResponse, assertResponsesAreEqual } from "https://deno.land/x/[email protected].1/reno/mod.ts";
import { createRonSwansonQuoteHandler } from "./routes.ts";

const createFetchStub = (response: string[]) =>
Expand Down Expand Up @@ -158,7 +158,7 @@ const router = createRouter(routes);
Reno emulates the middleware pattern, [found in Express](https://expressjs.com/en/guide/using-middleware.html), by favouring [function piping](https://www.sitepoint.com/function-composition-in-javascript/#theimportanceofinvocationorder) to create reusable, higher-order route handlers:

```ts
import { createRouteMap, jsonResponse, pipe } from "https://deno.land/x/[email protected].0/reno/mod.ts";
import { createRouteMap, jsonResponse, pipe } from "https://deno.land/x/[email protected].1/reno/mod.ts";

const withCaching = pipe(
(req, res) => {
Expand Down Expand Up @@ -187,11 +187,11 @@ export const routes = createRouteMap([["/", home]]);

## Example Apps

As well as the [example app found in this repo](https://github.com/reno-router/reno/tree/v1.3.0/example), which is targetted by the [end-to-end test suite](https://github.com/reno-router/reno#end-to-end-tests), there is a [standalone repository for a blog microservice](https://github.com/reno-router/blog-microservice) built with Deno, Reno, PostgreSQL, and Docker.
As well as the [example app found in this repo](https://github.com/reno-router/reno/tree/v1.3.1/example), which is targetted by the [end-to-end test suite](https://github.com/reno-router/reno#end-to-end-tests), there is a [standalone repository for a blog microservice](https://github.com/reno-router/blog-microservice) built with Deno, Reno, PostgreSQL, and Docker.

## API Documentation

Consult [Reno's entry on the Deno Doc website](https://doc.deno.land/https/deno.land/x/[email protected].0/reno/mod.ts) for comprehensive documentation on Reno's API.
Consult [Reno's entry on the Deno Doc website](https://doc.deno.land/https/deno.land/x/[email protected].1/reno/mod.ts) for comprehensive documentation on Reno's API.

## Local Development

Expand Down
2 changes: 1 addition & 1 deletion tools/generate-readme.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ function writeStringToFile(filename: string, contents: string) {
return Deno.writeFileSync(filename, encoder.encode(contents));
}

const { version } = parseTOML(readFileAsString("Package.toml")) as Metadata;
const { version } = parseTOML(readFileAsString("Package.toml")) as Record<keyof Metadata, string>;
const readmeTemplate = readFileAsString("README.template.md");

const updatedReadme = readmeTemplate
Expand Down

0 comments on commit ba9d79a

Please sign in to comment.