Skip to content

Commit

Permalink
added config
Browse files Browse the repository at this point in the history
  • Loading branch information
eduardomcv committed Jul 20, 2020
1 parent 2a9a96d commit 5053e3d
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions src/config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
import { Location, TemperatureUnit } from './sharedTypes';

export const OPEN_WEATHER_API_KEY = process.env.REACT_APP_API_KEY;

export const OPEN_WEATHER_API_ENDPOINT = 'https://api.openweathermap.org/data/2.5/weather';

export const LOCATION_VALUE_TO_LOCATION_QUERY_PARAM_MAP: Record<Location, string> = {
lisbon: 'lisbon,pt',
newyork: 'new+york,us',
london: 'london,uk',
};

export const TEMPERATURE_UNIT_VALUE_TO_UNITS_QUERY_PARAM_MAP: Record<TemperatureUnit, string> = {
celsius: 'metric',
farenheit: 'imperial',
};

0 comments on commit 5053e3d

Please sign in to comment.