feathers-versionate
About
Service nesting for feathersjs
Nests services under configurable base paths, and provides easy methods to access those services.
Getting Started
Install the module
NPM: npm install feathers-versionate --save
Yarn: yarn add feathers-versionate
var feathers = ;var versionate = ;var memory = ; const app = ;// Configure versionateapp;// Register a base-path "/api/v2", and provide access to it via `app.v2`app;// Now you can use `app.v2` to create and access services under the registered path!appv2; // http://localhost:3030/api/v2/users// We can access services easily too!const userService = appv2;
Documentation
feathers-versionate
It a utility that creates wrappers for app.use and app.service with nested root paths.
app.versionate(name, basePath)
app.versionate.register(name, basePath)
(app.versionate alias)
feathers-versionate
services
app.versionateName.use(path, service)
- wraps
app.use
and includes the versionate basePath behind the scenes
- wraps
app.versionateName.service(path)
- wraps
app.service
and includes the versionate basePath behind the scenes
- wraps
Examples
const app = ;// Configure versionateapp;// Register a versionate base pathsapp;// You can register as many "versionations" as you'd likeapp;// If the 3rd argument is set to true, the service will be nested under app.versionateapp;// Nesting under versionate is useful if you don't want to pollute `app` with lots of childrenappversionatedocs; // Once registered, you can use app.versionateName anywhere in your app!appv1;appv2; // Retrieve a service through the versionate nameconst usersV2 = appv2;// You can also access services by their full path on app.serviceconst usersV1 = app; // Use the service just like normalusersV2;
Release History
0.2.2
- Fix/add support for win32 systems
0.2.0
- Add app.versionate as main function
- Add tests
- Fix app.versionate nesting of service access methods
0.1.0
- Initial release
- Support for app.use and app.service