get food items from heroku server

This commit is contained in:
Bart Akeley 2017-10-29 20:18:33 -05:00
parent edf161099f
commit 16e970a0c7
2 changed files with 5 additions and 2 deletions

View file

@ -14,7 +14,8 @@
],
"globals": {
"Position": false,
"navigator": false
"navigator": false,
"__DEV__": true
},
"rules": {
// overrides

View file

@ -1,6 +1,8 @@
// @flow
import { memoize } from 'ramda';
const BASE_URL = 'aretherecookies.herokuapp.com';
export type FoodItemsFilter = {
radius?: number,
};
@ -26,7 +28,7 @@ export type FoodItemsForLocation = {
export const getFoodItemsForLocation = memoize(
async ({ pos: { coords: { latitude, longitude } } }: { pos: Position }): Promise<FoodItemsForLocation> => {
try {
return fetch('http://192.168.122.1:3000/fooditems', {
return fetch(`https://${BASE_URL}/fooditems`, {
method: 'POST',
headers: {
'Content-Type': 'application/json',