# @canner/statics

> statics

Latest version **1.1.1** (published 2017-09-27) · MIT license · 0 weekly downloads

## Install

```sh
npm install @canner/statics
pnpm add @canner/statics
yarn add @canner/statics
bun add @canner/statics
```

## Health

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

Positive: has types; no vulnerabilities; high quality score.

Warnings: low downloads; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.1.1 |
| Published | 2017-09-27 |
| First published | 2017-09-19 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | CommonJS |
| Node | >=6.0.0 |
| Dependencies | 11 |
| Known vulnerabilities | 0 (+1 in 1 direct dependencies) |
| Install scripts | no |
| Maintainers | abz53378, wwwy3y3, ctxhou, chilijung |

## Links

- npm: https://www.npmjs.com/package/@canner/statics
- npm.io page: https://npm.io/package/@canner/statics

## Dependencies (11)

- [koa](https://npm.io/package/koa.md) ^2.3.0
- [fresh](https://npm.io/package/fresh.md) ^0.5.1
- [is-url](https://npm.io/package/is-url.md) ^1.2.2
- [lodash](https://npm.io/package/lodash.md) ^4.17.4
- [bluebird](https://npm.io/package/bluebird.md) ^3.5.0
- [minimatch](https://npm.io/package/minimatch.md) ^3.0.4
- [koa-compose](https://npm.io/package/koa-compose.md) ^4.0.0
- [glob-slasher](https://npm.io/package/glob-slasher.md) ^1.0.1
- [path-to-regexp](https://npm.io/package/path-to-regexp.md) ^2.0.0
- [fast-url-parser](https://npm.io/package/fast-url-parser.md) ^1.1.3
- [string-to-stream](https://npm.io/package/string-to-stream.md) ^1.1.0

## Recent versions

- 1.1.1 (latest) — 2017-09-27
- 1.1.0 — 2017-09-20
- 1.0.0 — 2017-09-19

## README

# static
## Configuration

**rewrites:** you can specify custom route recognition for your application by supplying
an object to the routes key. Use a single star `*` to replace one URL segment or a
double star to replace an arbitrary piece of URLs. This works great for single page
apps. An example:

```json
{
  "rewrites": [
    {"source":"app/**","destination":"/application.html"},
    {"source":"projects/*/edit","destination":"/projects.html"}
  ]
}
```

**redirects:** you can specify certain url paths to be redirected to another url by supplying configuration to the `redirects` key. Path matching is similar to using custom routes. `redirects` use the `301` HTTP status code by default, but this can be overridden by configuration.

```json
{
  "redirects": [
    {"source":"/some/old/path", "destination":"/some/new/path"},
    {"source":"/apps/*", "destination":"https://www.app.com", "type": 302}
  ]
}
```

Route segments are also supported in the `redirects` configuration. Segmented `redirects` also support custom status codes (see above):

```json
{
  "redirects": [
    {"source":"/old/:segment/path", "destination":"/new/path/:segment"}
  ]
}
```

In this example, `/old/custom-segment/path` redirects to `/new/path/custom-segment`

**headers:** Superstatic allows you to set the response headers for certain paths as well:

```json
{
  "headers": [
    {
      "source" : "**/*.@(eot|otf|ttf|ttc|woff|font.css)",
      "headers" : [{
        "key" : "Access-Control-Allow-Origin",
        "value" : "*"
      }]
    }, {
      "source" : "**/*.@(jpg|jpeg|gif|png)",
      "headers" : [{
        "key" : "Cache-Control",
        "value" : "max-age=7200"
      }]
    }, {
      "source" : "404.html",
      "headers" : [{
        "key" : "Cache-Control",
        "value" : "max-age=300"
      }]
    }]
  }
}
```

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