Deployed at this Domain using vercel might be slow because of MongoDB cloud : https://fery-api.vercel.app/api-docs/debug-env#
This is a simple API for managing users and rides. The API includes endpoints for:
- Registering users
- Listing rides
- Fetching ride details
Endpoint: POST /api/users/register
Request Body:
{
"username": "testuser2",
"password": "securepassword"
}Endpoint: GET /api/rides
Response:
Endpoint: GET /api/rides/:id
Response (Valid ID):

Response (Invalid ID):
- Node.js
- Express.js
- MongoDB
- Mongoose
- Node.js and npm installed on your system.
- MongoDB (local or cloud).
- Clone the repository:
git clone https://github.com/Kimforee/FeryAPI cd FeryAPI - Install dependencies:
npm install npm install mongoose
- Set up the
.envfile:- Create a
.envfile in the root directory. - Add the following variables:
MONGO_URI=mongodb://localhost:27017/rides PORT=5000
- Create a
- Start the server:
Response:
npm run dev
> ride-api@1.0.0 dev > nodemon server.js [nodemon] 3.1.9 [nodemon] to restart at any time, enter `rs` [nodemon] watching path(s): *.* [nodemon] watching extensions: js,mjs,cjs,json [nodemon] starting `node server.js` Server running on port 5000 MongoDB Connected: ride-shard-00-01.chhcg.mongodb.net
- Use Postman or cURL to test the endpoints.
- Ensure MongoDB is running before testing.
├── controllers/
│ ├── rideController.js
│ ├── userController.js
├── models/
│ └── User.js
├── routes/
│ ├── rideRoutes.js
│ ├── userRoutes.js
├── utils/
│ └── mockRides.js
├── server.js
├── package.json
├── .env
├── README.md


