A Node.js RESTful API for managing car data.
- CRUD operations for cars
- Express.js server
- MongoDB integration (Mongoose)
- JWT authentication
- Node.js >= 14.x
- MongoDB
git clone https://github.com/yourusername/backend-api-cars.git
cd backend-api-cars
npm installCreate a .env file:
PORT=3000
MONGODB_URI=mongodb://localhost:27017/carsdb
JWT_SECRET=your_jwt_secret
npm start| Method | Endpoint | Description |
|---|---|---|
| GET | /api/cars | List all cars |
| GET | /api/cars/:id | Get car by ID |
| POST | /api/cars | Create a new car |
| PUT | /api/cars/:id | Update a car |
| DELETE | /api/cars/:id | Delete a car |