Every external call needs a timeout, every timeout needs a fallback — resilience patterns for HTTP, databases, and third-party services
88
90%
Does it follow best practices?
Impact
85%
4.72xAverage score across 5 eval scenarios
Passed
No known issues
Build a Node.js Express API for a travel planning service that aggregates data from multiple travel providers.
GET /api/travel/searchQuery parameters: origin, destination, departDate, returnDate, passengers
The endpoint searches multiple providers in parallel and returns combined results:
https://api.skyscanner.net/v3/flights/search) returns available flights with prices.https://api.booking.com/v2/hotels/search) returns hotels at the destination with prices and ratings.https://api.rentalcars.com/v1/search) returns available rental cars at the destination.https://api.viator.com/v1/activities/search) returns tours and activities at the destination.Return a combined response:
{
"search": {
"origin": "London",
"destination": "Paris",
"departDate": "2025-06-15",
"returnDate": "2025-06-20",
"passengers": 2
},
"flights": [
{ "airline": "Air France", "price": 120, "currency": "GBP", "departure": "08:30", "arrival": "11:00" }
],
"hotels": [
{ "name": "Hotel Le Marais", "pricePerNight": 95, "rating": 4.2, "stars": 3 }
],
"carRentals": [
{ "company": "Europcar", "category": "Economy", "pricePerDay": 35 }
],
"activities": [
{ "name": "Eiffel Tower Skip-the-Line", "price": 25, "duration": "2 hours" }
]
}API keys come from environment variables: SKYSCANNER_KEY, BOOKING_KEY, RENTALCARS_KEY, VIATOR_KEY.
Produce TypeScript files in a src/ directory:
src/index.ts -- Express server with the search routesrc/services/flights.ts -- search flightssrc/services/hotels.ts -- search hotelssrc/services/carRentals.ts -- search car rentalssrc/services/activities.ts -- search activitiessrc/types.ts -- TypeScript interfaces for all response typesDo not include test files or build configuration.