Skip to content

Commit

Permalink
testing backend API on loading of homepage
Browse files Browse the repository at this point in the history
  • Loading branch information
ravi-p-k-1 committed Feb 19, 2025
1 parent 9864202 commit 296fcaa
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
7 changes: 4 additions & 3 deletions frontend/web-app/src/Controller/AuthController.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,10 @@ import axiosInstance from "../Utils/axiosInstance";
class AuthController{
public getUsers= async (): Promise<any> =>{
try{
const response = await axiosInstance.get('/users');
const usersData = authService.getUsers(response.data);
return usersData;
const body={ "PlantID":19, "PlantName": "orchids", "ScientificName": "ordcha", "Threshhold": 20.0 }
const response = await axiosInstance.post('/plant/data', body);
// const usersData = authService.getUsers(response.data);
return response;
}catch(error){
throw new Error('Error getUsers');
}
Expand Down
2 changes: 1 addition & 1 deletion frontend/web-app/src/Utils/axiosInstance.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import axios from "axios";
// Dummy URL is used here we need to change it later.

const axiosInstance = axios.create({
baseURL: 'https://jsonplaceholder.typicode.com',
baseURL: 'http://sproutly.com/api',
timeout: 5000,
headers: {
"Content-Type": 'application/json',
Expand Down

0 comments on commit 296fcaa

Please sign in to comment.