Skip to content

Commit f3c0ad2

Browse files
author
Ilya Radchenko
committed
Add apidoc and start documenting API
run `npm run gendocs` to generate documentation. See http://apidocjs.com/#getting-started for help.
1 parent d9af01d commit f3c0ad2

File tree

4 files changed

+20
-1
lines changed

4 files changed

+20
-1
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,3 +18,4 @@ public/stylesheets/css/plugin-status-compiled.css
1818
test/last-shot
1919
/coverage
2020
/failures
21+
/apidocs

apidoc.json

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
{
2+
"name": "strider",
3+
"version": "1.0.0",
4+
"description": "Strider API",
5+
"apidoc": {
6+
"title": "Strider CI/CD REST API"
7+
}
8+
}

lib/routes/api/account.js

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,14 @@ var Project = models.Project;
1111

1212
router.use(auth.requireUserOr401);
1313

14+
/**
15+
* @api {put} /:provider/:id Update a User's provider account
16+
* @apiName UpdateAccount
17+
* @apiGroup Account
18+
*
19+
* @apiParam {String} provider Type of provider, e.g. github
20+
* @apiParam {Number} id Unique provider identification
21+
*/
1422
router.route('/:provider/:id')
1523
.put(function (req, res) {
1624
var accounts = req.user.accounts;

package.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,8 @@
5151
"build": "npm run pre && npm run styles && browserify -t [babelify --only client] -e client/app.js -o dist/scripts/app.js",
5252
"build-debug": "npm run pre && npm run styles-debug && browserify -d -e client/app.js -o dist/scripts/app.js",
5353
"unitcov": "istanbul cover _mocha --recursive test/unit",
54-
"unitdev": "mocha -w --recursive test/unit -R min"
54+
"unitdev": "mocha -w --recursive test/unit -R min",
55+
"gendocs": "apidoc -i lib/ -o apidocs/"
5556
},
5657
"dependencies": {
5758
"MD5": "^1.2.1",
@@ -124,6 +125,7 @@
124125
"devDependencies": {
125126
"angular": "1.2.23",
126127
"angular-route": "1.2.17-build.163.1",
128+
"apidoc": "^0.13.1",
127129
"babelify": "^6.1.2",
128130
"blanket": "^1.1.5",
129131
"bower-installer": "^1.2.0",

0 commit comments

Comments
 (0)