diff --git a/prosjekt-4/api/axiosREST.ts b/prosjekt-4/api/axiosREST.ts index 3c38c5db4098ec7c8deb6d4c6803f07dbbf6aed4..ab0ec104dead3bcc3de0f917c4c37d434f61d945 100644 --- a/prosjekt-4/api/axiosREST.ts +++ b/prosjekt-4/api/axiosREST.ts @@ -1,11 +1,17 @@ import axios from 'axios'; -const prod = { +import Constants from "expo-constants"; + +const { manifest } = Constants; + +// This gets the IP address of the host for Expo client. Makes you connect to the IP address of the machine on LAN +const url = `http://${manifest.debuggerHost.split(':').shift()}:8000`; + +const prod = { // The VM backend url: 'http://it2810-75.idi.ntnu.no:8000', }; -const dev = { - url: 'http://127.0.0.1:8000', - // url: 'http://localhost:8000', +const dev = { // Local backend + url, }; export const config = process.env.NODE_ENV === 'development' ? dev : prod; diff --git a/prosjekt-4/components/App.tsx b/prosjekt-4/components/App.tsx index 022fb79cf8d34bb45cb1e194bb371380140e03b9..a06003fdd6a4363b76df067745012f36958f7dfd 100644 --- a/prosjekt-4/components/App.tsx +++ b/prosjekt-4/components/App.tsx @@ -4,16 +4,32 @@ import LandingPage from '../pages/LandingPage'; import MoviePage from '../pages/MoviePage'; import React from 'react'; import { View } from 'react-native'; +import { useFonts } from 'expo-font'; +import { Ionicons } from '@expo/vector-icons'; +import { Container, Footer, Icon, Input, Item, Left, Text } from 'native-base'; +import SearchBar from './SearchBar'; +import Header from './Header'; const App = () => { + let [fontsLoaded] = useFonts({ + Roboto: require('native-base/Fonts/Roboto.ttf'), + Roboto_medium: require('native-base/Fonts/Roboto_medium.ttf'), + ...Ionicons.font, + }); + + if (!fontsLoaded) { + return ; + } + return ( - + +
- - + - +