0.1.0 • Published 4 years ago

egg-index v0.1.0

Weekly downloads
4
License
MIT
Repository
github
Last release
4 years ago

egg-index · GitHub license npm version npm downloads PRs Welcome

Support index.html for egg-static.

  • egg-static base on koa/static-cache.
  • egg-index: web homepage support, eg, / to /index.html.

Installation

npm install egg-index
// config/plugin.js
exports.index = {
  enable: true,
  package: 'egg-index',
};

Configuration

exports.idex = {
  // option, default to 'index.html'
  filename: 'index.html'
};

exports.static = {
  prefix: '/'
  dir: path.resolve('./myWeb'),
};

Now, available to access ./myWeb/index.html from '/'