- Create markdowns with contracts inside
./docsfolder - see also: proper MD files structure - Copy
./setupfiles to your root dir in project - Install dependencies by
yarncommand - Build project by
yarn buildcommand - Run
index.htmlin your browser or deploy it with netlify
Your MD files should have specific structure like this:
./docs
/Auth
post.login.md
post.register.md
/User
get.user.md
get.user_{uuid}.md
...
File names should have the same template: {method}.{name-or-uri}.md, where:
{method}is REST API method likepost,get,patch,put,delete, etc. ORmodelfor general models{name-or-uri}could be just a name likepaged-resultorurilike:user_{uuid}_roles
Examples:
get.user_{uuid}_roles}->GET user/{uuid}/rolesget.paged-result->GET paged-result
- Change api-contractor paths in
index.html, for each case:./node_modules/->lib/api-contractor/
- Create new netlify build
- Set netlify build command:
npm run build && cp -R ./node_modules/api-contractor ./lib/api-contractor - Deploy!