API Versioning

Create new versions of your API with ease

Creating a new API Version

Creating a new API version

By default, the first api version is made for you. If you decide to create a new version,you can generate a new one with new documentation built for each version individually.

$ node-rails new-api-version <YOUR-NEW-API-VERSION-NUMBER>$ npm run build:dev

What Was Generated

New Routes and Controller directory were created with a new API Docs

Inside of the controllers directory, you will see a new directory designated for the new api version. You can generate new controllers for any api version that you have created. Inside of the routes directory, you will see a new directory designated for the new api version. All routes created in the new directory will be found on the new API docs made for the new api version. The routes are prefixed with a "v" + YOUR-NEW-API-VERSION-NUMBER.

API Version 2 Example

Creating new api version with docs

$ node-rails new-api-version 2$ npm run build:dev

API Documentations for V2

Your api docs can be found after you rebuild webpack and rerun the server on dev.

API Version 2 Documentations will be found on http://localhost:8080/docs/v2
While API Version 1 Documentations will be found on http://localhost:8080/docs/v1

Alias Shortcut

API Version Shortcut

$ node-rails nav <YOUR-NEW-API-VERSION-NUMBER>