Skip to content

Commit

Permalink
actualizados endpoints
Browse files Browse the repository at this point in the history
  • Loading branch information
paulasuarezp committed Jun 29, 2024
1 parent d7bde26 commit e3223b1
Show file tree
Hide file tree
Showing 12 changed files with 14 additions and 15 deletions.
2 changes: 1 addition & 1 deletion restapi/app.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ const app: Application = express();

// Permitir peticiones de webapp y parsear el body a JSON
app.use(cors({
origin: "https://bidmonuniverse.eastus.cloudapp.azure.com",
origin: "*",
methods: ["GET", "POST", "PUT", "DELETE", "PATCH"],
credentials: true
}));
Expand Down
4 changes: 2 additions & 2 deletions restapi/server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ const server = http.createServer(app);

const io = new Server(server, {
cors: {
origin: "https://bidmonuniverse.eastus.cloudapp.azure.com",
methods: ["GET", "POST"]
origin: "*",
methods: ["GET", "POST", "PUT", "DELETE", "PATCH"],
}
});

Expand Down
2 changes: 1 addition & 1 deletion webapp/src/api/auctionsAPI.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { Auction } from "../shared/sharedTypes";

const apiEndPointBase = `${process.env.REACT_APP_API_URI}/auctions` || 'http://localhost:5001/api/auctions'; // Base URL for the Auction API endpoints
const apiEndPointBase = process.env.REACT_APP_API_URI ? `${process.env.REACT_APP_API_URI}/auctions` : 'http://localhost:5001/api/auctions'; // Base URL for the Auction API endpoints

/**
* Obtiene todas las subastas activas.
Expand Down
3 changes: 1 addition & 2 deletions webapp/src/api/bidsAPI.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import { Bid } from "../shared/sharedTypes";

const apiEndPointBase = `${process.env.REACT_APP_API_URI}/bids` || 'http://localhost:5001/api/bids'; // Base URL for the Auction API endpoints

const apiEndPointBase = process.env.REACT_APP_API_URI ? `${process.env.REACT_APP_API_URI}/bids` : 'http://localhost:5001/api/bids'; // Base URL for the Bid API endpoints

/**
* Obtiene una puja por su ID.
Expand Down
2 changes: 1 addition & 1 deletion webapp/src/api/cardAPI.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
const apiEndPointBase = `${process.env.REACT_APP_API_URI}/cards` || 'http://localhost:5001/api/cards'; // Base URL for the Card API endpoints
const apiEndPointBase = process.env.REACT_APP_API_URI ? `${process.env.REACT_APP_API_URI}/cards` : 'http://localhost:5001/api/cards'; // Base URL for the Card API endpoints

/**
* Obtiene las cartas del usuario desde el servidor utilizando una API.
Expand Down
2 changes: 1 addition & 1 deletion webapp/src/api/cardpacksAPI.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
const apiEndPointBase = `${process.env.REACT_APP_API_URI}/cardpacks` || 'http://localhost:5001/api/cardpacks'; // Base URL for the Card API endpoints
const apiEndPointBase = process.env.REACT_APP_API_URI ? `${process.env.REACT_APP_API_URI}/cardpacks` : 'http://localhost:5001/api/cardpacks'; // Base URL for the User API endpoints

/**
* Obtiene los sobres de cartas disponibles para su compra desde el servidor utilizando una API.
Expand Down
2 changes: 1 addition & 1 deletion webapp/src/api/decksAPI.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
const apiEndPointBase = `${process.env.REACT_APP_API_URI}/decks` || 'http://localhost:5001/api/decks'; // Base URL for the Card API endpoints
const apiEndPointBase = process.env.REACT_APP_API_URI ? `${process.env.REACT_APP_API_URI}/decks` : 'http://localhost:5001/api/decks'; // Base URL for the Card API endpoints

/**
* Obtiene los mazos de cartas disponibles para su compra desde el servidor utilizando una API.
Expand Down
2 changes: 1 addition & 1 deletion webapp/src/api/notificationsAPI.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
const apiEndPointBase = `${process.env.REACT_APP_API_URI}/notifications` || 'http://localhost:5001/api/notifications'; // Base URL for the Card API endpoints
const apiEndPointBase = process.env.REACT_APP_API_URI ? `${process.env.REACT_APP_API_URI}/notifications` : 'http://localhost:5001/api/notifications'; // Base URL for the User API endpoints

/**
* Verifica si el usuario tiene notificaciones no leídas.
Expand Down
2 changes: 1 addition & 1 deletion webapp/src/api/purchaseAPI.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
const apiEndPointBase = `${process.env.REACT_APP_API_URI}/purchases` || 'http://localhost:5001/api/purchases'; // Base URL for the Card API endpoints
const apiEndPointBase = process.env.REACT_APP_API_URI ? `${process.env.REACT_APP_API_URI}/purchases` : 'http://localhost:5001/api/purchases'; // Base URL for the User API endpoints

/**
* Realiza la compra de un sobre de cartas
Expand Down
2 changes: 1 addition & 1 deletion webapp/src/api/transactionsAPI.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
const apiEndPointBase = `${process.env.REACT_APP_API_URI}/transactions` || 'http://localhost:5001/api/transactions'; // Base URL for the Transaction API endpoints
const apiEndPointBase = process.env.REACT_APP_API_URI ? `${process.env.REACT_APP_API_URI}/transactions` : 'http://localhost:5001/api/transactions'; // Base URL for the Transaction API endpoints

/**
* Obtiene las transacciones de la carta del usuario desde el servidor utilizando una API.
Expand Down
3 changes: 2 additions & 1 deletion webapp/src/api/userAPI.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
const apiEndPointBase = `${process.env.REACT_APP_API_URI}/users` || 'http://localhost:5001/api/users'; // Base URL for the User API endpoints
const apiEndPointBase = process.env.REACT_APP_API_URI ? `${process.env.REACT_APP_API_URI}/users` : 'http://localhost:5001/api/users'; // Base URL for the User API endpoints

// Inicio de sesión
export async function login(username: string, password: string): Promise<any> {
console.log('URL:', apiEndPointBase);
const url = `${apiEndPointBase}/login`;

try {
Expand Down
3 changes: 1 addition & 2 deletions webapp/src/api/userCardsAPI.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
const apiEndPointBase = `${process.env.REACT_APP_API_URI}/usercards` || 'http://localhost:5001/api/usercards'; // Base URL for the User API endpoints

const apiEndPointBase = process.env.REACT_APP_API_URI ? `${process.env.REACT_APP_API_URI}/usercards` : 'http://localhost:5001/api/usercards'; // Base URL for the User API endpoints


/**
Expand Down

0 comments on commit e3223b1

Please sign in to comment.