Routify

A shitty tool to generate processable JSON data for routes.

Installation

npm install -g https://github.com/astridlol/routify

Usage

In order to use Routify, you need to add some comments to your routes. Here’s an example:

/** Allows a user to create an account
 * @route: /accounts/
 * @method: POST
 * @body: {username: string, password: string}
 * @returns: { success: true, ...accountData }
 */

After that, you can use Routify to generate a JSON file of your routes.

routify --file [file with routes]

By default, the file will be stored in the current directory, and will be named as so: API-[current-date]. In order to change the name of the file, you can use the --api flag.

routify --file [file with routes] --api [what the routes do]

Example

routify --file routes.js

But, how is this useful?

By itself, Routify is not very useful. However, it can be used as a base for other tools. Using the data generated by Routify, you can then easily process API data, and use it wherever you need it. For example, you could easily make a custom documentation site, or a Discord bot to get information on certain routes.

License

This project is licensed under the MIT license. See the LICENSE file for more information.

GitHub

View Github