
Fixing My Git Mistakes and Finally Understanding My Router Code
Today was one of those days where I didn’t just write code — I actually fixed my mistakes and understood what I built . Cleaning Up My Git Mistakes I realized I had made some serious beginner mistakes: I committed my .env file (which contains secrets) I pushed my database file to GitHub I didn’t have a .gitignore After guidance, I fixed everything properly: Removed .env and .db from the repository Created a .gitignore to avoid future mistakes Added .env.example to show required environment variables without exposing secrets This made me understand something important: A clean and secure repository is as important as working code. Understanding My Router Code Earlier, my router files were just “working code” for me. Today I actually understood what they do. What is a Router? In FastAPI, routers handle API requests. Example: @router.post ( " /login " ) def login (): return { " message " : " User logged in " } Now I understand: Router = entry point for requests It connects frontend reques
Continue reading on Dev.to Webdev
Opens in a new tab



