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: |
Zack Williams | 6c78f91 | 2018-06-21 10:56:24 -0700 | [diff] [blame^] | 6 | ./venv-xosdocs.sh |
Zack Williams | da8a5d8 | 2017-09-08 12:45:14 -0700 | [diff] [blame] | 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 | |
Zack Williams | 6c78f91 | 2018-06-21 10:56:24 -0700 | [diff] [blame^] | 11 | clean: swagger_clean venv_clean |
| 12 | |
Matteo Scandolo | 431781c | 2017-09-06 15:33:07 -0700 | [diff] [blame] | 13 | swagger_clean: |
| 14 | rm -rf swagger/specs/* |
| 15 | |
Zack Williams | da8a5d8 | 2017-09-08 12:45:14 -0700 | [diff] [blame] | 16 | venv_clean: |
| 17 | rm -rf $(DOCSDIR)venv-xosdocs |
| 18 | |
Matteo Scandolo | 431781c | 2017-09-06 15:33:07 -0700 | [diff] [blame] | 19 | swagger_serve_spec: |
| 20 | http-server --cors ./swagger |
| 21 | |
| 22 | # HOW TO |
| 23 | # - load the virtual env (https://guide.opencord.org/xos/dev/local_env.html) |
| 24 | # - run `make` |
| 25 | # - open the browser at `http://127.0.0.1:8080/ui` |
| 26 | # - you'll see the 'core' apis |
| 27 | # - you can see a list of available apis at `http://127.0.0.1:8080/specs/` |
| 28 | # - just replace the swagger file (top bar) with another one to see different APIs (to be improved) |