31 lines
653 B
Markdown
31 lines
653 B
Markdown
# agep-cargo Backend
|
|
|
|
This is a minimal Express backend for the AGEPOLY cargobike booking platform.
|
|
|
|
Setup
|
|
|
|
1. Copy the example env file and update it:
|
|
|
|
cp .env.example .env
|
|
# then edit .env to set DATABASE_URL
|
|
|
|
2. Install dependencies
|
|
|
|
npm install
|
|
|
|
3. Run migration (using psql or your database tool) to create the bookings table:
|
|
|
|
psql "$DATABASE_URL" -f migrations/create_bookings.sql
|
|
|
|
4. Start the server
|
|
|
|
npm run dev
|
|
|
|
API
|
|
|
|
- GET /api/health - health check
|
|
- GET /api/bikes - list available bike types
|
|
- POST /api/bookings - create a booking (bike_type, start_date, end_date, name, email)
|
|
- GET /api/bookings - list recent bookings
|
|
|
|
|