You can also access the REST API of the API server directly. It is running on the same host machine and port and can be accessed via the /api
route (in this case that is localhost:3000/api/
, so you can e.g. reach the API with localhost:3000/api/feed
).
/api/feed
: Fetch all published posts/api/filterPosts?searchString={searchString}
: Filter posts bytitle
orcontent
/api/post
: Create a new post- Body:
title: String
(required): The title of the postcontent: String
(optional): The content of the postauthorEmail: String
(required): The email of the user that creates the post
- Body:
/api/user
: Create a new user- Body:
email: String
(required): The email address of the username: String
(optional): The name of the user
- Body:
/api/publish/:id
: Publish a post by itsid
/api/post/:id
: Delete a post by itsid