README.md 1.03 KB
Newer Older
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
# Server providing data for dashboard frontend

## Start server locally
Before you start the backend itself, go into the database directory and execute `docker-compose up -d`. On first startup of the app, data will be written to this database.

Run `npm install` to download all dependencies.

Run `npm start` to start the server locally. It will listen on port 8081.

Please note: The script 'start:prod' in the package.json is only for production environment. It will also build and serve the frontend.

## Endpoints
The endpoints of our api are defined in the folder `src/routes`. 

Please note: All query parameters 'from' and 'to' are considered unix timestamps. 

Endpoint to get all bike points: 
- `/api/bike-points/all`

Endpoint for landing page: 
- `/api/bike-trip-durations`
- query params: from, to, classSize (in seconds)

Endpoint for bike point details page: 
- `/api/bike-point-details/:bikePointId`
- query params: from, to, selectedDay (0=Monday to 6=Sunday)

Endpoint for map page: 
- `/api/bike-points-activity`
- query params: from, to