Loading repository data…
Loading repository data…
matsjfunke / repository
basic todo app with fastapi backend and react frontend
A transparent discovery signal based on current public GitHub metadata.
This score does not audit code, security, maintainers, documentation quality, or suitability. Verify the repository and its current documentation before adoption.
# clone repo
git clone https://github.com/matsjfunke/react-fastapi-todo.git
# start docker containers
docker-compose -f docker-compose.yml up
this api.js file tells frontend where backend is located
/*
api.js creates an Axios instance named api with a base URL of http://localhost:8000,
which can be imported / used throughout the frontend app
to send HTTP requests to the specified server.
*/
import axios from 'axios'
const api = axios.create({
baseURL: 'http://localhost:8000',
})
export default api;
Cross-Origin Resource Sharing allows React frontend to access backend endpoints
origins = [
# react app runs there
"http://localhost:3000"
]
app.add_middleware(
CORSMiddleware,
allow_origins=origins,
allow_credentials=True,
allow_methods=["*"],
allow_headers=["*"]
)