Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/Secbone/koa-static2
Middleware for Koa2 to serve a folder under a name declared by user
https://github.com/Secbone/koa-static2
koa2
Last synced: about 2 months ago
JSON representation
Middleware for Koa2 to serve a folder under a name declared by user
- Host: GitHub
- URL: https://github.com/Secbone/koa-static2
- Owner: Secbone
- Created: 2016-01-29T11:31:55.000Z (almost 9 years ago)
- Default Branch: master
- Last Pushed: 2016-08-22T14:33:19.000Z (over 8 years ago)
- Last Synced: 2024-11-14T09:31:16.876Z (about 2 months ago)
- Topics: koa2
- Language: JavaScript
- Homepage:
- Size: 8.79 KB
- Stars: 13
- Watchers: 2
- Forks: 3
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
- awesome-koa - koa-static2 - 在用户声明的名称下的文件夹提供文件服务。 ![](https://img.shields.io/github/stars/Secbone/koa-static2.svg?style=social&label=Star) ![](https://img.shields.io/npm/dm/koa-static2.svg?style=flat-square) (仓库 / 中间件)
README
# Koa-static2
[![NPM version][npm-image]][npm-url]
[![Build Status][travis-image]][travis-url]
[![Downloads][downloads-image]][downloads-url]Middleware for [Koa2](https://github.com/koajs/koa/tree/v2.x) to serve a folder under a name declared by user
## Install
```
npm install koa-static2
```## Usage
```js
import Koa from "koa";
import serve from "koa-static2";const app = new Koa();
app.use(serve("static", __dirname + "/assets"));
```
## LicenseMIT
[npm-image]: https://img.shields.io/npm/v/koa-static2.svg?style=flat-square
[npm-url]: https://npmjs.org/package/koa-static2
[downloads-image]: http://img.shields.io/npm/dm/koa-static2.svg?style=flat-square
[downloads-url]: https://npmjs.org/package/koa-static2
[travis-image]: https://img.shields.io/travis/Secbone/koa-static2.svg?style=flat-square
[travis-url]: https://travis-ci.org/Secbone/koa-static2