/**
* 中间件:
* 将静态资源映射到指定路由
* @param {*} customizePath 本地资源所在绝对路径
* @param {string} [customizeStaticPath="static"] 路由名
* @returns function
*/
const handleStatic = require('koa-static-path')
// 使用字符串
app.use(handleStatic(path.join(__dirname,'./public/'),'public'))
// 使用数组多映射
app.use(handleStatic(path.join(__dirname,'./static'),['static','source'])
-
Notifications
You must be signed in to change notification settings - Fork 0
Carnia/koa-static-match-path
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
About
一个将静态资源映射到指定路由的中间件
Resources
Stars
Watchers
Forks
Releases
No releases published
Packages 0
No packages published