https://bw-picasso.herokuapp.com/
Expects JSON on the request body:
{
"username": "example",
"password": "example"
}
Returns 400 if username or password aren't present Returns 401 if credentials are invalid Returns 201 if user successfully created with token:
{
"token": "example"
}
Expects JSON on the request body:
{
"username": "example",
"password": "example"
}
Returns 400 if username or password aren't present Returns 401 if credentials are invalid Returns 200 if successfully logged in with token:
{
"token": "example"
}
Expects JSON on the request body:
{
"style": "example URL",
"content": "example URL"
}
Returns 200 if images were processed successfully with:
{
"output_url": "example URL"
}
In React app, declare a base URL for the API
const API_URL = "http://localhost:5555"
then add a change handler or submit hanlder that uploads the file to `/images/upload"
const handleChange = ({ target: { files } }) => {
const [file] = files
let body = new FormData()
body.append("user-image", file)
Axios.post(`${API_URL}/images/upload/`, body)
}
Note: The field name needs to be user-image