This package has been migrated to GitHub Packages.
New Location: https://github.com/orgs/Ambisafe/packages/npm/package/hapi-semver-plugin
Install from GitHub Packages:
# Add to .npmrc @ambisafe:registry=https://npm.pkg.github.com # Install npm install @ambisafe/hapi-semver-pluginThis GitLab repository is no longer maintained. Please use the GitHub Package.
hapi.js plugin for semver versioned paths
npm install --save @ambisafe/hapi-semver-plugin
hapi.js 18.x.x
- attach hapi.js plugin
import HapiSemverPlugin from '@ambisafe/hapi-semver-plugin';
import packageJson from '../../package.json';
await server.register({
register: HapiSemverPlugin,
options: {
defaultVersion: '*',
minValidVersion: '1.0.0',
maxValidVersion: packageJson.version
}
});
- transform all hapi routes
import { routesAddVersions } from '@ambisafe/hapi-semver-plugin';
export default routesAddVersions([...<hapi routes list>]);