Add complete React frontend with modern design and navigation

This commit is contained in:
Ryderjj89
2025-09-13 12:09:52 -04:00
parent fab87ca06b
commit 84f1dfaf23
12 changed files with 675 additions and 0 deletions

View File

@@ -0,0 +1,34 @@
import axios from 'axios';
const API_BASE_URL = process.env.REACT_APP_API_URL || 'http://localhost:3000';
const api = axios.create({
baseURL: API_BASE_URL,
headers: {
'Content-Type': 'text/plain',
},
});
export interface BookData {
books: string[];
}
export const getBooks = async (): Promise<BookData> => {
const response = await api.get('/books');
return response.data;
};
export const getBook = async (book: string): Promise<string> => {
const response = await api.get(`/books/${book}`);
return response.data;
};
export const getChapter = async (book: string, chapter: string): Promise<string> => {
const response = await api.get(`/books/${book}/${chapter}`);
return response.data;
};
export const checkHealth = async (): Promise<{ status: string; message: string }> => {
const response = await api.get('/health');
return response.data;
};