Zack Williams | da8a5d8 | 2017-09-08 12:45:14 -0700 | [diff] [blame] | 1 | DOCSDIR := $(dir $(abspath $(lastword $(MAKEFILE_LIST)))) |
| 2 | |
Matteo Scandolo | 431781c | 2017-09-06 15:33:07 -0700 | [diff] [blame] | 3 | swagger: swagger_clean swagger_docs swagger_serve_spec |
| 4 | |
Zack Williams | da8a5d8 | 2017-09-08 12:45:14 -0700 | [diff] [blame] | 5 | venv-xosdocs: |
| 6 | bash venv-xosdocs.sh |
| 7 | |
| 8 | swagger_docs: venv-xosdocs |
| 9 | bash -c 'source $(DOCSDIR)venv-xosdocs/bin/activate && python $(DOCSDIR)scripts/swagger_docs.py' |
Matteo Scandolo | 431781c | 2017-09-06 15:33:07 -0700 | [diff] [blame] | 10 | |
| 11 | swagger_clean: |
| 12 | rm -rf swagger/specs/* |
| 13 | |
Zack Williams | da8a5d8 | 2017-09-08 12:45:14 -0700 | [diff] [blame] | 14 | venv_clean: |
| 15 | rm -rf $(DOCSDIR)venv-xosdocs |
| 16 | |
Matteo Scandolo | 431781c | 2017-09-06 15:33:07 -0700 | [diff] [blame] | 17 | swagger_serve_spec: |
| 18 | http-server --cors ./swagger |
| 19 | |
| 20 | # HOW TO |
| 21 | # - load the virtual env (https://guide.opencord.org/xos/dev/local_env.html) |
| 22 | # - run `make` |
| 23 | # - open the browser at `http://127.0.0.1:8080/ui` |
| 24 | # - you'll see the 'core' apis |
| 25 | # - you can see a list of available apis at `http://127.0.0.1:8080/specs/` |
| 26 | # - just replace the swagger file (top bar) with another one to see different APIs (to be improved) |