This folder contains the backend code for the Temple Directory application. The backend is built with Node.js, Express.js, and MongoDB, and provides the necessary APIs to handle CRUD operations for managing temple data.
- Node.js
- Express.js
- MongoDB
- backend/
- app.js
- controllers/
-TempleController.js
- db/
- conn.js
- models/
- temple.js
- routes/
- router.js
- temples.js
The backend provides the following API endpoints for interacting with the temple data:
GET /api/temples
: Retrieves a list of all temples.GET /api/temples/:id
: Retrieves details of a specific temple.POST /api/temples
: Creates a new temple.PUT /api/temples/:id
: Updates the information of a specific temple.DELETE /api/temples/:id
: Deletes a specific temple.
The temple data is stored in a MongoDB database. The connection to the database is established using Mongoose, an Object Data Modeling (ODM) library for MongoDB and Node.js.
To run the backend server locally, follow these steps:
- Install Node.js and MongoDB on your machine.
- Clone this repository and navigate to the backend folder.
- Install the required dependencies by running the command:
npm install
. - Start the server with the command:
npm start
.
The server will start running at http://localhost:3000
.
You can test the API endpoints using a tool like Postman or by sending HTTP requests directly. Ensure that the backend server is running before testing the endpoints.
For more detailed instructions and information, refer to the frontend README.
If you have any questions or need further assistance, feel free to contact [Your Name] at your-email@example.com.