# koa-router-static

> Static file serving compatible with koa-router.

Latest version **1.2.0** (published 2016-05-17) · ISC license · 0 weekly downloads

> **Deprecated.** This package is deprecated.

## Install

```sh
npm install koa-router-static
pnpm add koa-router-static
yarn add koa-router-static
bun add koa-router-static
```

## Health

**Score 10/100 (F)** — status: deprecated.

Negative: deprecated.

## Facts

| | |
|---|---|
| Version | 1.2.0 |
| Published | 2016-05-17 |
| First published | 2016-05-17 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 1 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 3 |
| Author | Matheus Pratta |
| Maintainers | matpratta |

## Links

- npm: https://www.npmjs.com/package/koa-router-static
- Repository: https://github.com/MatheusMK3/koa-router-static/
- npm.io page: https://npm.io/package/koa-router-static

## Dependencies (1)

- [koa-send](https://npm.io/package/koa-send.md) ^3.2.0

## Recent versions

- 1.2.0 (latest) — 2016-05-17
- 1.1.0 — 2016-05-17
- 1.0.2 — 2016-05-17
- 1.0.1 — 2016-05-17

## README

# koa-router-static
Static file serving compatible with koa-router.

## Usage

Simply use the middleware in your router and choose a directory. The module will already find the file you requested and serve it for you.

Full-code example:

    var router require('koa-router')();
    var serve = require('koa-router-static');

    $.get('/*', serve('./assets/'));

In this case, the contents of the `assets` directory will be made available for your route.

You can also stack more than one serve (in case you want to have different assets for each route):

    var router require('koa-router')();
    var serve = require('koa-router-static');

    $.get('/*', serve('./images/'));
    $.get('/*', serve('./assets/'));

---
_Source: https://npm.io/package/koa-router-static · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
