From cac3b682d902e7079c84ce19fad6b8c0b21235a3 Mon Sep 17 00:00:00 2001 From: SandraBergstrom Date: Tue, 20 Jun 2023 06:44:56 +0000 Subject: [PATCH] #10 Install axios and add api --- src/App.js | 1 + src/App.module.css | 14 -------------- src/api/axiosDefaults.js | 5 +++++ 3 files changed, 6 insertions(+), 14 deletions(-) create mode 100644 src/api/axiosDefaults.js diff --git a/src/App.js b/src/App.js index 8b63bd9..2a323ff 100644 --- a/src/App.js +++ b/src/App.js @@ -2,6 +2,7 @@ import styles from './App.module.css' import NavBar from './components/NavBar'; import Container from 'react-bootstrap/Container'; import { Route, Switch } from 'react-router-dom'; +import './api/axiosDefaults' function App() { diff --git a/src/App.module.css b/src/App.module.css index 9a924d1..a759ea3 100644 --- a/src/App.module.css +++ b/src/App.module.css @@ -1,17 +1,3 @@ -/* Add general styles like hover effects and such */ - -:root { - /* Colors */ - --clr-primary-light: rgb(245, 245, 245); - --clr-primary-dark: rgb(35 32 14); - - --clr-natural-light: rgb(255, 250, 243); - - --clr-accent-pink: rgb(160 108 131); - --clr-accent-light: rgb(149, 164, 170); - --clr-accent-dark: rgb(72 102 113); -} - .App { background-color: var(--clr-primary-light); color: var(--clr-primary-dark); diff --git a/src/api/axiosDefaults.js b/src/api/axiosDefaults.js new file mode 100644 index 0000000..71cb7a2 --- /dev/null +++ b/src/api/axiosDefaults.js @@ -0,0 +1,5 @@ +import axios from "axios"; + +axios.defaults.baseURL = 'https://travel-tickr-api-e57198555b47.herokuapp.com/' //url to api +axios.defaults.headers.post['Content-Type'] = 'multipart/form-data' // multipart necessary since we have both text and images +axios.defaults.withCredentials = true \ No newline at end of file