Hosted here: https://journal-frontend-smoky.vercel.app/
How to run: rails s
- runs on port 3000
To run tests simply run rspec
Built in Ruby on Rails, the app is a RESTful API only for a React client. The API endpoints are below:
Returns a JSON array of all posts.
None
Sure! Here's the raw markdown for the Ruby on Rails controller actions documentation:
shell Copy code
Returns a JSON array of all posts.
None
[
{
"id": 1,
"title": "Example Post 1",
"content": "This is an example post.",
"label": "idea",
"created_at": "2023-07-31T12:34:56.789Z"
},
{
"id": 2,
"title": "Example Post 2",
"content": "Another example post.",
"label": "fun",
"created_at": "2023-07-31T15:30:00.000Z"
},
...
]
Returns a JSON array of posts with the specified label.
label
(string): The label to filter posts by.
Returns a JSON object representing the post with the specified ID.
id
(integer): The ID of the post to retrieve.
Returns a JSON object representing the post created on the specified date.
date
(string, format: "YYYY-MM-DD"): The date to filter posts by.
Creates a new post with the specified parameters.
post
(object): An object containing the post data.title
(string, required): The title of the post.content
(string, required): The content of the post.label
(string): The label of the post.created_at
(string, format: "YYYY-MM-DDTHH:mm:ss.SSSZ"): The creation date of the post.
Updates the post with the specified ID using the provided parameters.
id
(integer): The ID of the post to update.post
(object): An object containing the updated post data.title
(string): The updated title of the post.content
(string): The updated content of the post.label
(string): The updated label of the post.created_at
(string, format: "YYYY-MM-DDTHH:mm:ss.SSSZ"): The updated creation date of the post.
Deletes the post with the specified ID.
id
(integer): The ID of the post to delete.
Status: 204 No Content