This is a simple chat application built using Express.js and MongoDB.
These instructions will help you set up the project on your local machine for development and testing purposes.
- Node.js
- MongoDB
-
Clone the repository:
git clone <repository-url>
-
Navigate to the project directory:
cd express_mongoDB -
Install the dependencies:
npm install
-
Start MongoDB: Make sure MongoDB is running on your system. You can start it using the following command (assuming MongoDB is installed as a service):
mongod
-
Start the application:
npm start
or if you are using
nodemonfor development:nodemon
-
Access the application: The server will start on port 8080. You can access it at
http://localhost:8080.
- GET /chats: Fetch and display all chats.
- GET /chats/new: Display the form to create a new chat.
- POST /chats: Create a new chat.
- GET /chats/:id/edit: Display the form to edit a chat.
- PUT /chats/:id: Update an existing chat.
- GET /: Basic route to test the server.
express_mongoDB/ │
├── models/
│ └── chat.js # Chat model schema
├── public/
│ └── ... # Static files (CSS, JS, etc.)
├── views/
│ ├── edit.ejs # View for editing a chat
│ ├── newChat.ejs # View for creating a new chat
│ └── showAll.ejs # View for displaying all chats
├── index.js # Main server file
├── package.json # Project metadata and dependencies
└── README.md # This README file
- Express.js - The web framework used
- MongoDB - NoSQL database
- EJS - Template engine
Please read CONTRIBUTING.md for details on our code of conduct, and the process for submitting pull requests.
- ANUSHKA sharma-anushka
- Hat tip to anyone whose code was used