API: https://artist-portfolio-backend.herokuapp.com/
[POST]
URL: /api/auth/register/
Payload:
{
//example data sent
"username": "newuser",
"password": "lamepassword",
"email": "[email protected]"
}
Returns: object with user's info.
Example:
{
"id": 1,
"username": "newuser",
"password": __"hashed_password"__(bad practice, do not do this!!!),
"email": "[email protected]"
}
[POST]
URL /api/auth/login
Payload
{
"username": "newuser",
"password": "lamepassword"
}
Returns: object with welcome message and token(JWT).
Example:
{
"message":"welcome newuser!",
"token": __JWT_Token__
}
[GET]
URL /api/artist/:id
Returns: an array with user's artwork.
Example:
[
{
artist: __artist_name__,
title: __artwork_title__,
description: __artwork_desc__,
imgUrl: __img_src_of_artwork__,
likes: 0,
user_id: __id_of_user__
},
{
// more artwork
}
];
[POST]
URL /api/artist/new
Returns: object with message and artwork info entered.
Example:
{
"message": "added new work.",
{
"artist": __artist_name__,
"title": __artwork_title__,
"description": __artwork_desc__,
"imgUrl": __img_src_of_artwork__,
"likes": 0,
"user_id": __id_of_user__
}
}
[PUT]
URL /api/artist/artwork/:id
Payload: same as adding artwork but with edited information.
Returns
Example:
{
"updated": 1
}
[DELETE]
URL /api/artist/artwork/:id
Returns
Example:
{
"removed": 1
}