Get all fake user json data now
All Https methods are accepted
Does not actually modify server data.
GET
POST
PUT
PATCH
DELETE
Filtering
Example: /api/users?id=1
[
{
"id": 1,
"name": "John Doe",
"email": "JohnDoe@email.com",
"photoUrl": "https://cdn.pixabay.com/photo/2016/11/14/17/39/person-1824144_640.png"
}
]
Limit
Example: /api/posts?_limit=1
[
{
"id": 1,
"user_id": 1,
"title": "The Importance of Healthy Eating",
"content": "Eating healthy is crucial for maintaining a balanced lifestyle...",
"likes": 25,
"comments": 2
}
]
Full text search
Example: /api/comments?q=Enjoyed
[
{
"id": 1,
"user_id": 1,
"post_id": 1,
"comment": "Great post, John! Really enjoyed reading it."
}
]
POST
Sample users
| ID | Username | Password | Role |
|---|---|---|---|
| 1 | admin | admin | admin |
| 2 | user | user | user |
Routes
Sample login json
{
"username": "user",
"password": "user",
}
Successfull response
{
"token": "jwt token will be here"
}
NOTE!
Uses JWT session stored in cookies
Secret key to decode JWT: MY_SECRET_KEY