Skip to content
This repository was archived by the owner on Oct 20, 2026. It is now read-only.
hueyfreemanwasrightPublic archive

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Repository files navigation

Fleet API

Vehicle inventory API for Fleet car rental.

Elijah De La Cruz Garcia

Run

npm install
cp .env.example .env
npm start

Requires local MongoDB on 127.0.0.1:27017 (database: fleetDB). Server runs on the port set in .env (default 5000).

.env is required and is not committed to Git. Keys:

Key Purpose
PORT Express port
MONGO_URI MongoDB connection string
JWT_SECRET Signing secret for auth tokens

Endpoints

  • GET /api/vehicles - list all vehicles (200)
  • POST /api/vehicles - add a vehicle (201); requests missing licensePlate are rejected with 400 by validation middleware
  • Undefined URLs return 404; server errors are formatted as JSON by the global error handler

CORS

Requests are accepted from the Vite dev server at http://localhost:5173 and http://127.0.0.1:5173. Any other origin is rejected with 403 and receives no Access-Control-Allow-Origin header.

Frontend Integration

See INTEGRATION.md for the vite.config.js proxy configuration, the endpoint reference, and working fetch and axios examples.

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages