Skip to content

codebountycontributor/codebountytestrepo-public

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Car Listings Search 🔎

Simple Node.js + Express app that serves a JSON API for searching sample car listings and a minimal frontend UI.

Quick start

  1. Install dependencies:
npm install
  1. Run the app:
npm start
# or for dev with auto-reload (requires nodemon):
# npm run dev
  1. Open the UI in your browser: http://localhost:3000

API

  • GET /api/search
    • Query params: q, make, model, minYear, maxYear, minPrice, maxPrice, sortBy (priceAsc, priceDesc, yearAsc, yearDesc), limit, offset
    • Returns: { total, results }

Examples:

Search for Toyotas:

curl "http://localhost:3000/api/search?make=Toyota"

Free-text search:

curl "http://localhost:3000/api/search?q=electric"

Get a single car by id:

curl "http://localhost:3000/api/4"

Data

Sample data is in data/cars.json. This is in-memory for demo purposes — replace with a DB for production.


If you want, I can add tests, Dockerfile, or a more advanced UI next. ✅

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Packages

 
 
 

Contributors

Languages

  • JavaScript 51.3%
  • HTML 48.7%