Start work on frontend dev

This commit is contained in:
Stedoss 2022-10-30 20:42:49 +00:00
parent 8cd07e2063
commit 6ede39966b
3 changed files with 23 additions and 0 deletions

View File

@ -0,0 +1,8 @@
export class API {
constructor(private baseAPIUrl: string) {}
async getVenues() {
const response = await fetch(`${this.baseAPIUrl}/venue`);
await response.text();
}
}

View File

@ -0,0 +1,7 @@
export type TEnvironment = {
BaseAPIUrl: string;
};
export const Environment: TEnvironment = {
BaseAPIUrl: "https://localhost:7021"
};

View File

@ -1,3 +1,11 @@
import { API } from "../lib/api";
import { Environment } from "../lib/environment";
export function Index() { export function Index() {
const api = new API(Environment.BaseAPIUrl);
const a: any = "";
api.getVenues().then((data) => {
console.log(data);
}).catch(_ => console.log("some error"));
return(<div>Hello, index!</div>); return(<div>Hello, index!</div>);
}; };