Skip to content
Snippets Groups Projects
Commit b1fcab44 authored by Gilgard's avatar Gilgard
Browse files

set up env

parent 87acefb7
No related branches found
No related tags found
1 merge request!13User profile view
Pipeline #175999 passed
import axios from "axios"; import axios from "axios";
import { tokenHeader } from "./token-utils"; import { tokenHeader } from "./token-utils";
const VUE_APP_BASEURL = "http://65.108.62.223:3000/api/"; const API_URL = process.env.VUE_APP_BASEURL;
export function doLogin(loginRequest) { export function doLogin(loginRequest) {
return axios return axios
.post(VUE_APP_BASEURL + "login/authentication", loginRequest) .post(API_URL + "login/authentication", loginRequest)
.then((response) => { .then((response) => {
return response.data; return response.data;
}) })
...@@ -17,7 +17,7 @@ export function doLogin(loginRequest) { ...@@ -17,7 +17,7 @@ export function doLogin(loginRequest) {
export function registerUser(registerInfo) { export function registerUser(registerInfo) {
return axios return axios
.post(VUE_APP_BASEURL + "register", { .post(API_URL + "register", {
email: registerInfo.email, email: registerInfo.email,
firstName: registerInfo.firstName, firstName: registerInfo.firstName,
lastname: registerInfo.lastname, lastname: registerInfo.lastname,
...@@ -32,7 +32,7 @@ export function registerUser(registerInfo) { ...@@ -32,7 +32,7 @@ export function registerUser(registerInfo) {
export async function getUser(userid) { export async function getUser(userid) {
return axios return axios
.get(VUE_APP_BASEURL + "users/" + userid + "/profile", { .get(API_URL + "users/" + userid + "/profile", {
headers: tokenHeader(), headers: tokenHeader(),
}) })
.then((response) => { .then((response) => {
...@@ -45,7 +45,7 @@ export async function getUser(userid) { ...@@ -45,7 +45,7 @@ export async function getUser(userid) {
export function getRenterRating(userid) { export function getRenterRating(userid) {
return axios return axios
.get(VUE_APP_BASEURL + "users/" + userid + "", { .get(API_URL + "users/" + userid + "", {
headers: tokenHeader(), headers: tokenHeader(),
}) })
.then((response) => { .then((response) => {
...@@ -58,7 +58,7 @@ export function getRenterRating(userid) { ...@@ -58,7 +58,7 @@ export function getRenterRating(userid) {
export function getOwnerRating(userid) { export function getOwnerRating(userid) {
return axios return axios
.get(VUE_APP_BASEURL + "users/" + userid + "", { .get(API_URL + "users/" + userid + "", {
headers: tokenHeader(), headers: tokenHeader(),
}) })
.then((response) => { .then((response) => {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment