Skip to content

Commit

Permalink
Upgrade dependencies and use path-to-regexp@6
Browse files Browse the repository at this point in the history
  • Loading branch information
blakeembrey committed Nov 22, 2019
1 parent 385fa67 commit 21d1abb
Show file tree
Hide file tree
Showing 5 changed files with 736 additions and 383 deletions.
16 changes: 9 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,17 +16,19 @@ npm install servie-mount --save
## Usage

```ts
import { mount } from "servie-mount";
import { mount, path, params, originalUrl } from "servie-mount";
import { compose } from "throwback";
import { Response } from "servie";

const subapp = compose([
function() {
return new Response("hello world");
}
]);
const fn = req => {
console.log(req[path]); // Get mounted path.
console.log(req[params]); // Get mounted params.
console.log(req[originalUrl]); // Get original URL string.

const app = compose([mount("/hello", subapp)]);
return new Response("hello world");
};

const app = compose([mount("/hello", fn)]);
```

## TypeScript
Expand Down
Loading

0 comments on commit 21d1abb

Please sign in to comment.