Activate Virtual Environment (what's venv?)
python3 -m venv ./brewniverse-env
cd brewniverse-env
source ./bin/activate
git clone git@github.com:nicholasgriffen/brewniverse-server
Install Dependencies (what's pip?)
cd brewniverse-server
pip install -r requirements.txt
CORS_WHITELIST=['localhost:8000']
SECRET='$3CR3T'
Run the Tests (what's manage.py?)
End-to-end test require the following environment variables:
TEST_USER_NAME
TEST_USER_PASS
All tests: python manage.py test posts/
Exclude end-to-end tests: python manage.py test --exclude-tag=e2e posts/
python manage.py runserver
POST
- body:
JSON: { username: String, password: String }
- headers:
"Content-Type": "application/json"
- return:
Object: { access: String, refresh: String }
POST
- body:
JSON: { refresh: <Token> }
- headers:
"Content-Type": "application/json"
- return:
Object: { access: <Token> }
POST:
- body:
JSON: { content: String, title: String, score: Int, rating: Int, picture: String, tags: Array<Tag> }
- headers:
"Content-Type": "application/json", "Authorization": "Bearer <token>"
- return:
Object: { id: Int content: String, title: String, score: Int, rating: Int, picture: String, tags: Array<Tag> }
GET
- body: null
- headers: null
- return:
Array<Object> [ { id: Int content: String, title: String, score: Int, rating: Int, picture: String, tags: Array<Tag> } ]
GET
- body: null
- headers: null
- return:
Object: { id: Int content: String, title: String, score: Int, rating: Int, picture: String, tags: Array<Tag> }
PATCH
- body:
JSON: { content: String?, title: String?, score: Int?, rating: Int?, picture: String?, tags: Array<Tag>? }
- headers:
"Content-Type": "application/json", "Authorization": "Bearer <token>"
- return:
Object: { id: Int content: String, title: String, score: Int, rating: Int, picture: String, tags: Array<Tag> }
PUT
- body:
JSON: { content: String, title: String, score: Int, rating: Int, picture: String, tags: Array<Tag> }
- headers:
"Content-Type": "application/json", "Authorization": "Bearer <token>"
- return:
Object: { id: Int content: String, title: String, score: Int, rating: Int, picture: String, tags: Array<Tag> }
DELETE
- body: null
- headers:
"Authorization": "Bearer <token>"
- return: null
GET
- body: null
- headers: null
- return:
Array<Object> [{ id: Int, username: String, picture: String, posts: Array<Post>, channels: Array<Tag> }]
POST
- body:
JSON: { email: String, username: String, password: String }
- headers:
"Content-Type": "application/json"
- return:
Object: { id: Int, username: String, picture: String, posts: Array<Post>, channels: Array<Tag> }
GET
- body: null
- headers: null
- return:
Object: { id: Int, username: String, picture: String, posts: Array<Post>, channels: Array<Tag> }
PATCH
- body:
JSON: { email: String?, username: String?, picture: String?, channels: Array<Tag>? }
- headers:
"Content-Type": "application/json", "Authorization": "Bearer <token>"
- return:
Object: { id: Int, username: String, picture: String, posts: Array<Post>, channels: Array<Tag> }
PUT
- body:
JSON: { email: String, username: String, picture: String, channels: Array<Tag> }
- headers:
"Content-Type": "application/json", "Authorization": "Bearer <token>"
- return:
Object: { id: Int, username: String, picture: String, posts: Array<Post>, channels: Array<Tag> }
DELETE
- body: null
- headers:
"Authorization": "Bearer <token>"
- return: null
GET
- body: null
- headers: null
- return:
Array<Object>: [{ tag: String, id: Int, posts: Array<Post> }]
GET
- body: null
- headers: null
- return:
Object: { tag: String, id: Int, posts: Array<Post> }