Note: My http server with react app

之前練習React 的時候,簡單用Golang 寫過Backend (https://github.com/KunYi/go-echo-react-todo)

這幾天練習建立的Http Server 測試了一下,差不多靜態檔案沒有問題,今天就找時間把上面測試用的專案簡單的API 用這個基礎也實做一下,結果發現果然用人家現成寫好的架構,程式大小是大,記憶體也花的多,但是省時間,用C語言自己寫其中需要的部份可能要多出10倍時間,需要注意的事項對一些人可能真的不是很有友善,光是寫資料結構,想要怎樣路由等等都要多花很多時間
完成成果 放在 https://github.com/KunYi/MingleJet_Http/tree/todos ,不過這個還是算一邊寫一邊整理的,還是有些亂,要做的好的話,需要多幾次重整才行


Previously, when practicing React, I wrote a simple backend with Golang (https://github.com/KunYi/go-echo-react-todo).

In the past few days, I’ve been practicing building an Http Server and testing it. Static files seem to be working fine, so today I took the time to implement the simple API of the above test project using this foundation.

As expected, using someone else’s pre-written framework makes the program size and memory usage larger, but it saves time. Writing the required parts in C language myself may take 10 times longer, and the things to pay attention to may not be very friendly to some people. Just writing data structures, how to route, etc., will take a lot of time.

The finished product is located at https://github.com/KunYi/MingleJet_Http/tree/todos, but this is still a work in progress and is a bit messy. It needs to be reorganized several times to be done well.

Key takeaways:

  • Using a pre-written framework can save time but will increase program size and memory usage.
  • Writing a backend in C language is more time-consuming but gives you more control over the program.
  • There are many things to consider when writing a backend, such as data structures and routing.

發表留言