Skip to content

hm496/egg-static-plus

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

31 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

egg-static-plus

Static server plugin for egg, base on egg-static.

Install

$ npm i egg-static-plus

Configuration

egg-static-plus support all configurations in koa-static-cache. and with default configurations below:

  • prefix: '/public/'
  • dir: path.join(appInfo.baseDir, 'app/public')
  • dynamic: true
  • preload: false
  • maxAge: 31536000 in prod env, 0 in other envs
  • buffer: true in prod env, false in other envs

egg-static-plus provides three more option:

  • maxFiles: the maximum value of cache items, only effective when dynamic is true, default is 1000.
  • staticFileFilter: null, path filter function [New!]
  • pathRewrite: null, path rewrite function [New!]

Packages

No packages published

Languages

  • JavaScript 100.0%