koa-index
    TypeScript icon, indicating that this package has built-in type declarations

    0.1.3 • Public • Published

    koa-index

    Commitizen friendly

    Serve directory listings for Koa

    Install

    NPM

    Screenshot

    screenshot

    Usage

    import Koa from 'koa'
    import path from 'path'
    import koaStatic from 'koa-static'
    import koaIndex from 'koa-index'
    
    const app = new Koa()
    
    // require koa-static send file
    app.use(
      koaStatic(__dirname, {
        hidden: true
      })
    )
    
    app.use(
      koaIndex(__dirname, {
        hidden: true
      })
    )
    
    app.listen(8080)

    API

    interface IOpts {
      hidden?: boolean
    }
    
    koaIndex(root:string, opts:IOpts)

    Options

    • hidden: Display hidden (dot) files. Defaults to false.

    License

    MIT

    Install

    npm i koa-index

    DownloadsWeekly Downloads

    98

    Version

    0.1.3

    License

    MIT

    Unpacked Size

    30.1 kB

    Total Files

    23

    Last publish

    Collaborators

    • avatar