1.0.2 • Published 6 years ago

retra-static v1.0.2

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

retra-static

Serve static files from your retra server, in Node!

GitHub | NPM

Install

npm i retra-static

About retra

retra is a powerful, lightweight, and extensible Node.js HTTP server framework.

Use retra-static

First, require the extension.

const static = require('retra-static')

Then enable it through your retra app.

// ... require path module
// ...create your retra app

app.use(static(path.join(__dirname, 'static')))
// This will instruct retra-static to serve out files from the /static directory

Use a custom index file name

The index file for directories defaults to index.html.

app.use(static(path.join(__dirname, 'static')), 'main.html')

// This will serve out directories' main.html files (if present) when directories are requested.