筆記應用開發日誌:後端連線初遇瓶頸
日期:2023年10月27日
今天主要完成了筆記應用前端介面的基礎搭建,主要處理了筆記列表的顯示邏輯和編輯器元件的整合。目前,使用者介面看起來已經有模有樣,基本的互動功能也跑得起來。我用 Vue.js 寫的,感覺在元件化方面確實效率很高。然而,在嘗試連線後端API時,遇到了意料之中的阻礙——資料同步問題。
初步判斷是後端服務在接收前端請求時,未能正確處理或響應。我仔細檢查了API路由配置、資料庫連線狀態以及後端服務的日誌輸出。前端傳送的請求在瀏覽器開發者工具中顯示為成功,但後端日誌卻一片平靜,這讓我開始懷疑是不是請求根本沒到達伺服器,或者是到達後被默默地忽略了。我甚至檢查了防火牆設定,雖然我知道這通常不是我這個級別的錯誤,但以防萬一嘛,畢竟踩坑是開發的必經之路,還是得小心求證。
接下來的計劃是,我會從後端服務的請求處理流程入手,重新梳理一遍。先確認路由是否正確對映到控制器,再檢查控制器內部處理邏輯,特別是資料庫操作部分。如果這些都沒問題,我可能會單獨寫個小指令碼測試資料庫的連線和 CRUD 操作,排除資料庫本身的故障。我相信這只是個邏輯上的小彎路,靜下心來總能找到癥結所在。畢竟,開發的樂趣不就在於解決這些自己挖的坑嗎?
Notes App Development Log: Initial Backend Connection Bottleneck
Date: 2023-10-27
Today I mainly finished the basic setup of the notes app's front end, focusing on the display logic for the notes list and integrating the editor component. Right now the user interface already looks decent and the basic interactions are working. I wrote it with Vue.js; it really feels very efficient for componentization. However, when I tried to connect to the backend API I ran into an expected obstacle — a data synchronization issue.
My initial assessment is that the backend service isn't correctly handling or responding to requests from the front end. I carefully checked the API route configuration, the database connection status, and the backend service logs. The requests sent by the front end show as successful in the browser dev tools, but the backend logs are completely quiet. That made me start to suspect that the requests never reached the server at all, or that they were silently ignored after arriving. I even checked the firewall settings — I know this usually isn't the kind of mistake I'd make, but just in case; stepping into pitfalls is part of development, so better to verify carefully.
My plan going forward is to start with the backend service's request handling flow and go through it again. First confirm that routes are correctly mapped to controllers, then check the internal controller logic, especially the database operation parts. If those are all fine, I might write a small standalone script to test the database connection and CRUD operations to rule out a database issue. I believe this is just a small logical detour; if I calm down I'll always be able to find the root cause. After all, isn't the fun of development about solving the holes we dig ourselves?