Added auth to endpoints

This commit is contained in:
Benjamin Sherriff
2023-10-18 15:36:36 -04:00
parent 7ba0e070ac
commit f072a47d22
12 changed files with 160 additions and 84 deletions

View File

@@ -5,10 +5,10 @@ const servicePort = process.env.SERVICE_PORT || 5000;
export async function getRequest(
url: string,
params: AxiosRequestConfig<any>
config?: AxiosRequestConfig<any>
): Promise<AxiosResponse<any, any> | undefined> {
const response = await axios
.get(`${serviceHost}:${servicePort}/${url}`, { params })
.get(`${serviceHost}:${servicePort}/${url}`, config)
.catch((error) => console.error(error));
return response || undefined;
}