src/api.js
/**
     * Create the API routes from a specification.
     *
     * @param {object} specification
     * @param {string} secret
     * @param {class} Backend
     * @param {class} logger
     * @param {function} callback
     * @param {object} controllers
     * @param {string} root
     *
     * @return {OpenAPIBackend}
     */
Create the API routes from a specification.


Create the API routes from a specification .
static create({
        specification,
        secret,
        Backend,
        logger,
        callback,
        controllers,
        root,
    }) {
        const apiRoutes = new ApiRoutes(specification, Backend, callback, root);
        apiRoutes.setControllers(controllers);
        if (logger) {
            apiRoutes.setLogger(logger);
        }
        if (secret) {
            apiRoutes.authentication(secret);
        }
        apiRoutes.register();
        return apiRoutes.api;
    }
static create ( { specification , secret , Backend , logger , callback , controllers , root , } ) { const apiRoutes = new ApiRoutes ( specification , Backend , callback , root ) ; apiRoutes . setControllers ( controllers ) ; if ( logger ) { apiRoutes . setLogger ( logger ) ; } if ( secret ) { apiRoutes . authentication ( secret ) ; } apiRoutes . register ( ) ; return apiRoutes . api ; }
Create the API routes from a specification.
Create the API routes from a specification .