This is a Node.js API for Health Centers. It uses Express.js and Nodemon, with MongoDB and Mongoose for database operations. The connection to the MongoDB database is set up using a connection string from Atlas.
- Clone the repository
- Run
npm install
to install the dependencies - Create a
.env
file in the root directory of the project and add your MongoDB Atlas connection string asDB_CONNECTION_STRING
- Run
npm start
to start the application
The API has the following routes:
GET /centers
: Get all health centersPOST /centers
: Create a new health centerGET /centers/:id
: Get a specific health centerPUT /centers/:id
: Update a specific health centerDELETE /centers/:id
: Delete a specific health center
The Health Center model has the following schema:
{
name: String,
address: String,
city: String,
state: String,
zip: String
}
npm start
: Start the applicationnpm run dev
: Start the application with Nodemon for automatic reloading
- express: Web framework for Node.js
- mongoose: ODM for MongoDB
- nodemon: Utility for automatic reloading of the application
- dotenv: Module for loading environment variables from a
.env
file
Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.