A simple CRUD application. This app allows users to create, edit, and delete chat messages. It provides basic CRUD functionality for chat messages, and the app stores data in a MongoDB database.
- Create a new chat: Allows users to send messages to a recipient.
- Edit a chat: Modify the content of any existing chat message.
- Delete a chat: Remove any chat message from the database.
- View all chats: Displays a list of all chat messages.
- MongoDB: Database for storing chat data.
- Express.js: Backend web framework.
- Node.js: JavaScript runtime for server-side programming.
- EJS: Templating engine for rendering HTML views.
- Method Override: For handling HTTP methods like PUT and DELETE in forms.
Ensure you have Node.js and MongoDB installed on your machine.
git clone https://github.com/username/repository-name.git
cd repository-name
npm install
(Optional) If you haven't set up MongoDB locally, you might want to install and run it. If you are using a cloud MongoDB, make sure to update the connection string in your code. Ensure MongoDB is running or use your cloud MongoDB connection URL
npm start
The app should now be accessible at http://localhost:8080
- GET /chats: Display all chats.
- GET /chats/new: Display a form to create a new chat.
- POST /chats: Create a new chat and save it to the database.
- GET /chats/:id/edit: Display a form to edit a specific chat message.
- PUT /chats/:id: Update a specific chat message.
- DELETE /chats/:id: Delete a specific chat message.