Hotel Finder Backend

This directory contains the backend API for the Hotel Finder application.

Structure

  • index.ts - Main entry point for the HTTP API
  • services/hotelService.ts - Service for fetching hotel data

API Endpoints

GET /api/hotels

Fetches hotels by zip code.

Query Parameters:

  • zipCode (required) - The zip code to search for hotels

Response:

{ "hotels": [ { "id": "string", "name": "string", "address": "string", "zipCode": "string", "city": "string", "state": "string", "rating": 4.5, "amenities": ["string"], "imageUrl": "string", "weeklyPrice": 700, "nightlyPrice": 120 } ], "totalResults": 5, "zipCode": "10001" }

Notes

  • The current implementation uses mock data. In a production environment, this would be replaced with calls to a real hotel API.
  • Hotels are sorted by weekly price (lowest to highest).