From 2e13c9afb0f91d56df29ad29e34f271f10d45f18 Mon Sep 17 00:00:00 2001 From: Justin Campbell Date: Thu, 1 Jul 2021 01:42:07 -0400 Subject: [PATCH] Update README.md --- README.md | 21 +++++++++++++++------ 1 file changed, 15 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index fb82479..74838c2 100644 --- a/README.md +++ b/README.md @@ -5,14 +5,20 @@ A Python based parser and RESTful API for ECN's webqueue. See https://pages.github.itap.purdue.edu/ECN/webqueue2-api/ ## Installation +1. Create virtual environment named __venv__ ```bash -# Create virtual environment named __venv__ python3 -m venv __venv__ -# Active virtual environment +``` +2. Active virtual environment +```bash source __venv__/bin/activate -# Update pip +``` +3. Update pip +```bash pip install -U pip -# Install package +``` +4. Install package +```bash pip install git+https://github.itap.purdue.edu/ECN/webqueue2-api@1.0.0#egg=webqueue2api ``` @@ -40,10 +46,12 @@ print( len( ce_1.subject ) ) ``` ## API Usage +1. Start the API in the background ```bash -# Start the API in the background gunicorn --daemon webqueue2api.api:app -# Login +``` +2. Login (replace `bob` and `super_secret` with your career account credentials.) +```bash curl -X POST \ -H "Content-Type: application/json" \ -d '{"username": "bob", "password": "super_secret"}' \ @@ -53,6 +61,7 @@ curl -X POST \ # Expected Output {"access_token": "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpYXQiOjE2MjUxMTc4OTAsIm5iZiI6MTYyNTExNzg5MCwianRpIjoiMzZhODYzYmEtNmFhNS00NDc1LTk5NmYtMjhjMTcxZTc4N2M5IiwiZXhwIjoxNjI1MTE4NzkwLCJzdWIiOiJjYW1wYjMwMyIsImZyZXNoIjpmYWxzZSwidHlwZSI6ImFjY2VzcyIsImNzcmYiOiJkZDA4NmYzMi1lYTEwLTQxNmYtODg3NS1iZTFjZDkwZjkwMTAifQ.SEf_oTxr5vtvMndGtHo9By51LBgAWEQAVcX_N5t0twA"} ``` + ## Contributing 1. Clone the git repo: ```bash