This commit is contained in:
Harrison Deng 2022-04-09 15:34:24 -05:00
parent fd916a8d63
commit af6f9cd131
6 changed files with 31 additions and 20 deletions

View File

@ -1,11 +0,0 @@
export default class Match {
id;
minUsers;
MaxUsers;
registeredUsers;
dateTime;
duration;
sport;
difficulty;
title;
}

View File

@ -1,8 +0,0 @@
export default class User {
firstName;
lastName;
email;
age;
biography;
id;
}

View File

@ -1,8 +1,9 @@
import React from "react";
import { apiClient } from "../utils/httpClients";
export default class Welcome extends React.Component {
constructor(props) {
super(props);
this.recentMatchesRequest = apiClient.get("/match/recent/15");
}
render() {

View File

@ -0,0 +1,6 @@
import axios from "axios";
export const apiClient = axios.create({
baseURL: process.env.API_HOST,
timeout: 5000,
});

View File

@ -12,6 +12,7 @@
"bcrypt": "^5.0.1",
"body-parser": "^1.19.2",
"connect-mongo": "^4.6.0",
"cors": "^2.8.5",
"express": "^4.17.3",
"express-session": "^1.17.2",
"mongoose": "^6.2.8",
@ -692,6 +693,18 @@
"resolved": "https://registry.npmjs.org/cookie-signature/-/cookie-signature-1.0.6.tgz",
"integrity": "sha1-4wOogrNCzD7oylE6eZmXNNqzriw="
},
"node_modules/cors": {
"version": "2.8.5",
"resolved": "https://registry.npmjs.org/cors/-/cors-2.8.5.tgz",
"integrity": "sha512-KIHbLJqu73RGr/hnbrO9uBeixNGuvSQjul/jdFvS/KFSIH1hWVd1ng7zOHx+YrEfInLG7q4n6GHQ9cDtxv/P6g==",
"dependencies": {
"object-assign": "^4",
"vary": "^1"
},
"engines": {
"node": ">= 0.10"
}
},
"node_modules/cross-spawn": {
"version": "7.0.3",
"resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.3.tgz",
@ -3701,6 +3714,15 @@
"resolved": "https://registry.npmjs.org/cookie-signature/-/cookie-signature-1.0.6.tgz",
"integrity": "sha1-4wOogrNCzD7oylE6eZmXNNqzriw="
},
"cors": {
"version": "2.8.5",
"resolved": "https://registry.npmjs.org/cors/-/cors-2.8.5.tgz",
"integrity": "sha512-KIHbLJqu73RGr/hnbrO9uBeixNGuvSQjul/jdFvS/KFSIH1hWVd1ng7zOHx+YrEfInLG7q4n6GHQ9cDtxv/P6g==",
"requires": {
"object-assign": "^4",
"vary": "^1"
}
},
"cross-spawn": {
"version": "7.0.3",
"resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.3.tgz",

View File

@ -20,6 +20,7 @@
"bcrypt": "^5.0.1",
"body-parser": "^1.19.2",
"connect-mongo": "^4.6.0",
"cors": "^2.8.5",
"express": "^4.17.3",
"express-session": "^1.17.2",
"mongoose": "^6.2.8",