### Preview API documentation locally Source: https://github.com/alaress/schoolbox-api-docs/blob/develop/README.md Build the documentation for a specific version and start a local server to preview the API reference. ```bash npm run build --build-version=0.0.1 --selected ``` ```bash python3 -m http.server --directory docs; ``` -------------------------------- ### Path file naming convention Source: https://github.com/alaress/schoolbox-api-docs/blob/develop/openapi/paths/README.md Example of how to name path files using the '@' separator to represent path nesting. ```text user.yaml # /user paths, i.e. GET to search for users, POST to create user user@{id}.yaml # /user/{id} paths, i.e. PUT to update, DELETE to delete ``` -------------------------------- ### Build API documentation Source: https://github.com/alaress/schoolbox-api-docs/blob/develop/README.md Bundles the current definition to a versioned YAML file and updates the build options list. ```bash npm run build --build-version=$buildVersion [--selected] ``` -------------------------------- ### Recreate builds list Source: https://github.com/alaress/schoolbox-api-docs/blob/develop/README.md Rebuilds the docs/builds.json file based on existing files in the docs/builds directory. ```bash npm run rebuild-builds-list ``` -------------------------------- ### Validate API definition Source: https://github.com/alaress/schoolbox-api-docs/blob/develop/README.md Runs the test suite to validate the API definition. ```bash npm test ``` -------------------------------- ### Enforce HTTPS protocol Source: https://github.com/alaress/schoolbox-api-docs/blob/develop/docs/old.html This script checks if the current protocol is HTTP and redirects to HTTPS unless the debug query parameter is present. ```javascript if ('http:' === window.location.protocol && '?debug' !== window.location.search) { window.location.protocol = 'https:'; } ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.