This API provides endpoints for managing buses, stops, and routes for a college bus service.
Ensure you have a .env
file in the root directory with the following values:
MONGODB_URI=<your MongoDB URI>
-
Clone the repository:
git clone https://github.com/avvicky/navme-backend.git
-
Install dependencies:
cd navme-backend npm install
-
Start the server:
npm start
- URL:
/api/buses
- Method:
GET
- Description: Retrieves a list of all buses.
- Response Body:
id
: String (Unique identifier for the bus)busNumber
: StringdriverName
: StringdriverPhoneNumber
: String
- URL:
/api/buses/{id}
- Method:
GET
- Description: Retrieves details of a specific bus.
- Path Parameters:
id
: String (Unique identifier for the bus)
- Request Body:
id
: String
- Response Body:
id
: StringbusNumber
: StringdriverName
: StringdriverPhoneNumber
: String
- URL:
/api/buses
- Method:
POST
- Description: Creates a new bus.
- Request Body:
busNumber
: String (required)driverName
: String (required)driverPhoneNumber
: String (required)
- Response Body:
id
: StringbusNumber
: StringdriverName
: StringdriverPhoneNumber
: String
- URL:
/api/buses
- Method:
PUT
- Description: Updates an existing bus.
- Request Body:
id
: String (required)busNumber
: String
- Response Body:
id
: StringbusNumber
: StringdriverName
: StringdriverPhoneNumber
: String
- URL:
/api/buses
- Method:
DELETE
- Description: Deletes a bus.
- Request Body:
busId
: String (required)
See Swagger Documentation at http://localhost:3000/api-docs