This is a backend for a simple social media application. It is created using django as the backend framework and MongoDB as the database provider.
- /api/create: This endpoint creates an account using the username and password provided as its request.
{
"username": "GhoulRe",
"password": "1234"
}
{
"return": "created"
}
or
{
"return": "invalid"
}
or
{
"return": "already exists"
}
- /api/login: This is used to handle logging in
{
"username": "GhoulRe",
"password": "1234"
}
{
"return": "correct"
}
or
{
"return": "invalid"
}
The text for the second login return case is kept as "invalid" for consistency
- /api/chats: This is used to handle logging in
{
"users": ["GhoulRe", "GhoulKing"]
}
[
{"from": "GhoulRe", "text": "Hello"}
{"from": "GhoulKing", "text": "Hi"}
]
or
[]
- /api/send: This is used to handle logging in
{
"users": ["GhoulRe", "GhoulKing"],
"message": {
"from": "GhoulRe",
"message": "How you doing?"
}
}
{
"from": "GhoulRe",
"message": "How you doing?"
}