hapi-static-files
v2.0.0
Published
Hapi plugin to serve static files with a predefined configuration
Downloads
5
Readme
hapi-static-files
Hapi plugin to serve static files with CORS enabled and maximum cache time.
Installation
npm install hapi-static-filesUsage
// CommonJS
// const HapiStaticFiles = require('hapi-static-files');
// ES6
import HapiStaticFiles from 'hapi-static-files';
// Registration
await server.register({
plugin: HapiStaticFiles,
options: {
path: 'public' // Absolute path or relative to the root folder of the project.
}
});Testing
Clone the repository and execute:
npm testContribute
- Fork it:
git clone https://github.com/softonic/hapi-static-files.git - Create your feature branch:
git checkout -b feature/my-new-feature - Commit your changes:
git commit -am 'Added some feature' - Check the build:
npm run build - Push to the branch:
git push origin my-new-feature - Submit a pull request :D
