{"id":15572818,"url":"https://github.com/howardabrams/express-api-docs","last_synced_at":"2025-04-24T02:14:59.969Z","repository":{"id":2561230,"uuid":"3540409","full_name":"howardabrams/express-api-docs","owner":"howardabrams","description":"A way to use Dox to document the public REST API provided by Express","archived":false,"fork":false,"pushed_at":"2012-03-19T18:48:50.000Z","size":114,"stargazers_count":14,"open_issues_count":3,"forks_count":6,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-04-24T02:14:38.736Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/howardabrams.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2012-02-24T22:29:53.000Z","updated_at":"2019-01-30T05:06:36.000Z","dependencies_parsed_at":"2022-09-10T04:04:14.152Z","dependency_job_id":null,"html_url":"https://github.com/howardabrams/express-api-docs","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/howardabrams%2Fexpress-api-docs","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/howardabrams%2Fexpress-api-docs/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/howardabrams%2Fexpress-api-docs/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/howardabrams%2Fexpress-api-docs/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/howardabrams","download_url":"https://codeload.github.com/howardabrams/express-api-docs/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":250546097,"owners_count":21448263,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-10-02T18:06:54.086Z","updated_at":"2025-04-24T02:14:59.950Z","avatar_url":"https://github.com/howardabrams.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"A simple wrapper for generating REST API documentation for [Express](http://expressjs.com/)-based\nprojects. This combines the parsing of [dox][1] with a [Handlebars][2]\ntemplate engine to produce HTML documentation describing a REST interface.\n\nKeep in mind, the project makes some assumptions, so you probably want\nto really just clone this project and change it.\n\nInstallation\n------------\n\nYou can install by either running the following command:\n\n    npm install express-api-docs\n\nOr adding the appropriate line to your `package.json` file.\n\nUsing\n-----\n\nCreate a JavaScript file, like `make-docs.sh` that contains the\nfollowing:\n\n       var api = require('express-api-docs');\n       api.generate('app.js', 'public/api.html');\n\nThe `api` variable has a single function, `generate()`, which\ntakes two parameters:\n\n  * Input file specifies an `app` or `router` script (see below).\n  * Output file where the HTML code should be placed.\n\n\nRouter File\n-----------\n\nCurrently, the project reads a single file for all the routes. While most\nprojects use the `app.js` file, you could separate the routes into another file \nthat the `app.js` file calls. Something like a `router.js` file:\n\n    /**\n     * Routes all API requests to particular functions.\n     * This file would be referenced by the `app.js` file, as:\n     *\n     *      var app    = express.createServer();\n     *      var routes = require('./router');\n     *\n     * And called:\n     *\n     *      routes.setup(app);\n     */\n\n    var index = require('./routes/index');\n    var user = require('./routes/user');\n\n    module.exports.setup = function( app ) {\n        app.get(   '/',            index.index );\n        app.get(   '/user',        user.getAllUsers);  \n        app.post(  '/user',        user.createUser);  \n        app.get(   '/user/:email', user.getUser ); \n        app.delete('/user/:email', user.deleteUser);        \n        app.put(   '/user/:email', user.updateUser );\n    };\n\nThe *parsing* code for analyzing the routes is currently very brittle\nand will be the first piece to be retooled.\n\nResource Entries\n----------------\n\nThe documentation also reads [Express-Resource](https://github.com/visionmedia/express-resource)\nentries. For instance:\n\n    app.resource('user',     require('./resources/user'));\n    app.resource('register', require('./resources/register'));\n    app.resource('apps',     require('./resources/application'));\n    app.resource('services', require('./resources/service'));\n\nIn this case, the files are read and the REST routes are determined based on\n*the name of the function*:\n\n  * `GET     /name`              -\u003e  `index()`\n  * `GET     /name/new`          -\u003e  `new()`\n  * `POST    /name`              -\u003e  `create()`\n  * `GET     /name/\u003cID\u003e`       -\u003e  `show()`\n  * `GET     /name/\u003cID\u003e/edit`  -\u003e  `edit()`\n  * `PUT     /name/\u003cID\u003e`       -\u003e  `update()`\n  * `DELETE  /name/\u003cID\u003e`       -\u003e  `destroy()`\n\n\nRelease Notes\n-------------\n\n### v 0.0.4\n\nBug Fix: Variable names that require other files now can include underbar\ncharacters.\n\n### v 0.0.3\n\nWork with both **Express** routes (e.g. `app.get`) as well as \n**Express Resource** projects (e.g. `app.resource`).\n\n### v 0.0.2\n\nMinor Update: Templates now use the **Handlebars** project.\n\n### v 0.0.1\n\nInitial project that can parse a given JavaScript file containing **Express**\nroutes, e.g. `app.get` and `app.post`, and infer the comments from the \nreferenced files. ","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhowardabrams%2Fexpress-api-docs","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhowardabrams%2Fexpress-api-docs","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhowardabrams%2Fexpress-api-docs/lists"}