Commit 3699a010 authored by Hedda's avatar Hedda
Browse files

#13 not fetching data

parent acfee6e7
import Axios from "axios"
import axios from "axios"
const createURL = (input) => {
const API_URL = "http://it2810-10.idi.ntnu.no:3001/api/"
const API_URL = "http://localhost:3001/api/"
if(input == undefined){
return API_URL +"getData"
}
......@@ -12,7 +12,6 @@ const createURL = (input) => {
return API_URL + "search/" + input
}
if(typeof input == 'number'){
return API_URL + "fiveMostPopular"
}
}
......@@ -20,7 +19,7 @@ const createURL = (input) => {
export const GetData = (input) => {
const url = createURL(input)
console.log("Her er url: ",url)
return Axios.get(url);
return axios.get(url)
}
/*
......
......@@ -18,7 +18,6 @@ class Card extends Component {
var locations = GetData(5)
locations.then((data) => {console.log(data);this.setState({data: data})})
}
}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment