Went through couple of tutorials and documentations, including main documentation here.Following it, created two files :
1) example.js
var currentUser={
name='Mary'
};
/**
* @api {get} /user/ Request User information
* @apiName GetUser
* @apiGroup User
*/
function getUser(){
return {code 200,data:currentUser};
}
function setName(name){
if(name.length==0){
return {code:404,message:'NameEmptyError'};
}
currentUser.name=name;
return {code 204};
}
2) testpython.py
"""
@api {get} /user/ Request User information
@apiName GetUser
@apiGroup User
"""
print "hello"
Saved both of them in a folder, say "my_project". On mac terminal, went to parent directory of "my_project". Ran the script :
apidoc -i my_project/ -o apidoc/
Getting error :
- ERROR - Failed to parse sources
It's basic, but somehow, not getting success.