@hx-midway/static-file
Version:
Midwayjs static-file alias 自动扫描,支持路径索引,允许 /path/index.html -> /path/
31 lines (26 loc) • 588 B
Markdown
static dirs 目录下的静态文件, 并提供访问路径,
/path/to/static/file/index.html => /static/path/to/static/file
/path/to/static/file/index.ejs => /static/path/to/static/file
```
* 安装
```bash
npm install @hx-midway/static-file --save
```
* 使用
```js
import * as staticFile from '@hx-midway/static-file';
@Configuration({
imports: [
koa,
staticFile
],
importConfigs: [
join(__dirname, 'config')
]
})
export class MainConfiguration { }
```
* 配置同 `@midwayjs/static-file`
* 介绍
```
静态文件服务, 支持自动扫描