Skip to content

Commit

Permalink
docs: more info
Browse files Browse the repository at this point in the history
  • Loading branch information
TomerAberbach committed Apr 10, 2024
1 parent e5cb9c1 commit 28230c3
Showing 1 changed file with 11 additions and 5 deletions.
16 changes: 11 additions & 5 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,12 @@

## Features

- **Wow:** so amazing
- **Amazing:** so wow
- **Fancy:** has a tie and everything
- **Flexible:** completely framework agnostic
- **Powerful:** specify redirects using
[`path-to-regexp` patterns](https://github.com/pillarjs/path-to-regexp?tab=readme-ov-file#parameters)
- **Readable:** configure using a
[Netlify `_redirects`](https://docs.netlify.com/routing/redirects#syntax-for-the-redirects-file)-like
syntax

## Install

Expand All @@ -39,7 +42,10 @@ $ npm i redirect-url
import { createRedirectUrl, parseRedirectUrl } from 'redirect-url'

let redirectUrl = createRedirectUrl([
// Nice :)
[`/bliss`, `https://www.youtube.com/watch?v=dQw4w9WgXcQ`],

// Other redirects...
{ from: `/home`, to: `/`, status: 307 },
[`/:splat*.html`, `/:splat*`],
])
Expand All @@ -63,8 +69,8 @@ console.log(redirectUrl(`https://example.com/spaghetti`))
//=> null
```

This package can be used in any server or framework, but see some examples
below. Feel free to send pull requests for more examples!
This package can be used with any server or framework, but see some example
integrations below. Feel free to send pull requests for more examples!

### Express

Expand Down

0 comments on commit 28230c3

Please sign in to comment.