feat/ make function documentary

This commit is contained in:
Clement 2024-05-16 11:32:01 +02:00
parent 1d6b334c74
commit 30d1e62b81

View File

@ -3,9 +3,15 @@ import express from "express"
import * as dotenv from "dotenv";
dotenv.config({path: '../../.env'})
const key = process.env.OPEN_TRIP_MAPS_KEY
/**
* make GET request to the OTM for radius search.
* @param {string} lon Longitude of radius center point
* @param {string} lat Latitude du point central du rayon
* @param {string} radius search radius size in meters
* @returns {FeatureCollection} a list of POIs with their type, id, etc. (cf: [opentripmap](https://dev.opentripmap.org/docs#))
*/
async function callRadius(lon: string, lat: string, radius = '1000') {
const optionsDrink = {
method: 'GET',
@ -28,7 +34,11 @@ async function callRadius(lon: string, lat: string, radius = '1000') {
}
}
/**
* make GET request to the OTM for city info.
* @param {string} name Name of a city
* @returns {Geoname} info of a search city their name, country, lat, lon, etc. (cf: [opentripmap](https://dev.opentripmap.org/docs#))
*/
async function callCity(name:string) {
const optionsCity = {
method: 'GET',
@ -70,7 +80,7 @@ export async function getCity(req: express.Request, res: express.Response) {
}
/**
* Handle GET request for city search route ('/otm/radius').
* Handle GET request for radius search route ('/otm/radius').
* @param {express.Request} req - HTTP Request object.
* @param {express.Response} res - HTTP Response object.
*/