# Node.js Job Management API
This Node.js project implements an API for managing job-related data. It provides endpoints for retrieving, creating, updating, and deleting job information.
## Getting Started
### Prerequisites
- Node.js installed
- MongoDB instance running
### Installation
1. Clone the repository:
```bash
git clone <repository_url>
```-
Install dependencies:
cd <project_folder> npm install
-
Set up environment variables:
- Create a
.envfile based on the provided.env.examplefile. - Configure MongoDB URI and other necessary environment variables.
- Create a
-
Start the server:
npm start
- Description: Fetches all jobs created by the logged-in user.
- Request: No parameters required.
- Response:
job: An array containing job objects.count: Number of jobs fetched.
- Description: Retrieves a specific job by its ID.
- Request:
id: ID of the job to retrieve.
- Response:
job: The job object found.
- Description: Creates a new job.
- Request Body:
company: Name of the company for the job.position: Position/title of the job.- Other optional job details.
- Response:
job: The newly created job object.
- Description: Updates an existing job by its ID.
- Request:
id: ID of the job to update.- Request Body: Fields to update (
company,position, etc.).
- Response:
job: The updated job object.
- Description: Deletes a job by its ID.
- Request:
id: ID of the job to delete.
- Response: No content.
- The API handles common errors such as invalid requests, missing data, and not found cases with appropriate HTTP status codes and error messages.
express: Web framework for Node.js.mongoose: MongoDB object modeling tool.http-status-codes: Utility to work with HTTP status codes.
Feel free to contribute by submitting issues or pull requests.
This project is licensed under the MIT License - see the LICENSE file for details.