2.1.0 • Published 8 years ago

@rill/static v2.1.0

Weekly downloads
15
License
MIT
Repository
github
Last release
8 years ago

A static file server for Rill. Internally node-static is used and all options are valid.

Installation

Npm

npm install @rill/static

Example

const app = require('rill')()
const static = require('@rill/static')

// Directory can be relative to where node_modules are installed or an absolute path.
// Cache time will use the `ms` module to parse time strings, otherwise use milliseconds.
app.use(static('public', { gzip: true, cache: '30 days' }))

// You can also serve a directory at a specific path.
app.at('/assets/*', server('assets_folder')) // -> /assets/test.txt will look in project/assets_foler/test.txt

API

static(directory, options) - All files in the provided directory will automatically be served.

Contributions

  • Use npm test to run tests.

Please feel free to create a PR!

2.1.0

8 years ago

2.0.1

8 years ago

2.0.0

9 years ago

1.0.0

9 years ago

0.5.0

10 years ago

0.4.1

10 years ago

0.4.0

10 years ago

0.3.0

10 years ago

0.2.0

10 years ago

0.1.0

10 years ago

0.0.5

10 years ago

0.0.4

10 years ago