This is a CRUD/REST API that simulates a commenting web app created using Node.js and Express, with EJS templates for practicing web development skills.
- Node.js
- Express
- EJS (Embedded JavaScript) templates
- GET
/comments/new- Description: Fetches the page for creating a new comment.
- POST
/comments- Description: Adds a new comment.
- Parameters: None (Data sent in the request body).
- GET
/comments- Description: Fetches the page to render all comments.
- GET
/comments/:id- Description: Fetches a specific comment by ID.
- Parameters:
:id- The ID of the comment.
- GET
/comments/:id/edit- Description: Fetches the page for editing a comment.
- Parameters:
:id- The ID of the comment to be edited.
- PATCH
/comments/:id- Description: Updates a specific comment by ID.
- Parameters:
:id- The ID of the comment to be updated.
- Data sent in the request body for partial updates.
- DELETE
/comments/:id- Description: Deletes a specific comment by ID.
- Parameters:
:id- The ID of the comment to be deleted.
- Clone or download this repository.
- Install the required dependencies using
npm install. - Run 'node index.js'.
- Use your web browser (localhost /comments | localhost/comments/new, and so on...)
I created this web app while ago while studying node/express and so on...