Welcome to the documentation for the Real Estate API. This application allows users to upload details of houses up for sale in a specified area and retrieve information about these houses.
Base URl:
Authentication is not currently required to access the API endpoints.
Upload details of a house up for sale.
- Endpoint:
POST /houses
- Request Body:
{ "house_type": "string", "address": { "city": "string", "area": "string", "pincode": "string", "state": "string", "country": "string" }, "price": "number", "negotiable": "string", "owner_details": { "name": "string", "address": "string", "email": "string", "phone": "string" }, "status": "string" }
- Response:
{ "message": "House details uploaded successfully" }
- Status Code: 201
Retrieve details of a specific house by its ID.
- Endpoint:
GET /houses/:id
- Response:
{ "house_type": "string", "address": { "city": "string", "area": "string", "pincode": "string", "state": "string", "country": "string" }, "price": "number", "negotiable": "string", "owner_details": { "name": "string", "address": "string", "email": "string", "phone": "string" }, "status": "string" }
- Status Code: 200
Retrieve a list of all houses up for sale.
- Endpoint:
GET /houses
- Response:
[ { "house_type": "string", "address": { "city": "string", "area": "string", "pincode": "string", "state": "string", "country": "string" }, "price": "number", "negotiable": "string", "owner_details": { "name": "string", "address": "string", "email": "string", "phone": "string" }, "status": "string" } ]
- Status Code: 200
- 400 Bad Request: The request body is invalid.
- 404 Not Found: The requested resource does not exist.
- 500 Internal Server Error: An error occurred on the server.
- Node.js
- MongoDB
- Clone the repository
- Install the dependencies by running
npm install
- Navigate to the 'api' directory
- Start the server by running
npm start
To run the tests for the applicatiion we can use Postman or any other API testing tool.