fix: replace hardcoded API url's with absolute paths

fixes issue #10
This commit is contained in:
Jordan Knott 2020-07-20 17:36:17 -05:00
parent 20b5188662
commit 70802ff4c9
3 changed files with 3 additions and 3 deletions

View File

@ -36,7 +36,7 @@ const Projects = () => {
fileData.append('file', e.target.files[0]);
const accessToken = getAccessToken();
axios
.post('http://localhost:3333/users/me/avatar', fileData, {
.post('/users/me/avatar', fileData, {
headers: {
Authorization: `Bearer ${accessToken}`,
},

View File

@ -18,7 +18,7 @@ const profile = {
id: '1',
fullName: 'Jordan Knott',
username: 'jordanthedev',
profileIcon: { url: 'http://localhost:3333/uploads/headshot.png', bgColor: '#000', initials: 'JK' },
profileIcon: { url: '/uploads/headshot.png', bgColor: '#000', initials: 'JK' },
};
export const Default = () => {
return (

View File

@ -8,7 +8,7 @@ export function getAccessToken() {
}
export async function getNewToken() {
return fetch('http://localhost:3333/auth/refresh_token', {
return fetch('/auth/refresh_token', {
method: 'POST',
credentials: 'include',
}).then(x => {