# restify-url-semver-parser

> Extract version number from URL and adds this number as the value for request accept-version header

Latest version **1.0.3** (published 2018-06-13) · MIT license · 0 weekly downloads

## Install

```sh
npm install restify-url-semver-parser
pnpm add restify-url-semver-parser
yarn add restify-url-semver-parser
bun add restify-url-semver-parser
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.3 |
| Published | 2018-06-13 |
| First published | 2018-03-04 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 3 |
| Unpacked size | 5.2 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | Dwight Rodriques |
| Maintainers | drodriques |
| Keywords | restify, semantic versioning, semver, versioning |

## Links

- npm: https://www.npmjs.com/package/restify-url-semver-parser
- Repository: https://github.com/drodriques/restify-url-semver-parser
- Homepage: https://github.com/drodriques/restify-url-semver-parser#readme
- Issues: https://github.com/drodriques/restify-url-semver-parser/issues
- npm.io page: https://npm.io/package/restify-url-semver-parser

## Dependencies (3)

- [semver](https://npm.io/package/semver.md) ^5.5.0
- [restify](https://npm.io/package/restify.md) ^6.3.4
- [restify-errors](https://npm.io/package/restify-errors.md) ^6.0.0

## Recent versions

- 1.0.3 (latest) — 2018-06-13
- 1.0.2 — 2018-06-12
- 1.0.1 — 2018-03-05
- 1.0.0 — 2018-03-04

## README

# restify-url-semver-parser

> Extract version number from URL and adds this number as the value for request 'accept-version' header.

## Install

```bash
npm i restify-url-semver-parser -S
````

## Usage

Import package:

```js
const restifyUrlSemverParser = require('restify-url-semver-parser');
```

Apply plugin:

```js
const server = restify.createServer();
server.pre(restifyUrlSemverParser);
```

Define route:

```js
server.get({ path: '/', version: '1.2.3' }, (req, res, next) => {
  // Route implementation
});
```

Use [semantic versioning](https://semver.org/): MAJOR.MINOR.PATCH

Example:

1. http:example.com/v1.0.0/foo
2. http:example.com/v1.0.0-alpha/foo
3. http:example.com/v1.0.0-alpha+001/foo

The lowercase `v` as used in examples above is required.

## License

  MIT

---
_Source: https://npm.io/package/restify-url-semver-parser · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
