Skip to content

Commit

Permalink
Merge pull request #4 from kerriestauffer/backend-endpoints-alexis
Browse files Browse the repository at this point in the history
Backend endpoints alexis
  • Loading branch information
alstr-a committed May 13, 2023
2 parents 66bcc8c + c450d61 commit 36b05c7
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions backend/src/routes/routes.controller.ts
Expand Up @@ -7,7 +7,7 @@ export interface RouteQueryParams {
mode: string
}

@Controller('routes')
@Controller('trips')
export class RoutesController {

constructor(private readonly routesService: RoutesService) {}
Expand All @@ -22,10 +22,10 @@ export class RoutesController {
name: 'routeQueryParams',
description: 'coordinates, mode',
})
findRoute(@Query() routeQueryParams: RouteQueryParams) {
findTrip(@Query() routeQueryParams: RouteQueryParams) {
console.log(routeQueryParams)
try {
return this.routesService.getRoute(routeQueryParams.coordinates, routeQueryParams.mode);
return this.routesService.getTrip(routeQueryParams.coordinates, routeQueryParams.mode);
} catch(error){
throw new Error(error);
}
Expand Down
2 changes: 1 addition & 1 deletion backend/src/routes/routes.service.ts
Expand Up @@ -13,7 +13,7 @@ export class RoutesService {

constructor(private httpService: HttpService){}

async getRoute(coordinates: any, mode: any) {
async getTrip(coordinates: any, mode: any) {
console.log('params: ' + coordinates + ' mode ' + mode)
console.log(`${this.osrm_trip_url}/v1/${mode}/${coordinates}?geometries=geojson`)
const routes$ = this.httpService.get(`${this.osrm_trip_url}/v1/${mode}/${coordinates}?geometries=geojson`);
Expand Down

0 comments on commit 36b05c7

Please sign in to comment.