Form encoding complex objects with node and express

I’ve been writing a small demo app, and wanted to keep everything simple, meaning no SPA / frontend frameworks. So I made an express app, with handlebars and just HTML form posts. I was trying to do a form post with a complex object, including arrays. I ran into an issue on the syntax of the input names so that the object is properly parsed by express. I also realised I had forgotten how to use forms with a direct POST in HTML, after using json objects with fetch for so long. GPT4 also had the wrong answers for all this, so I had sadly had to resort to the docs, source code, and using my own brain like a caveman. The format isn’t documented on the urlencoded page on the expressjs website itself, but it points to the underlying library qs where it show some examples. Hopefully this post provides some training data for GPT5.

Read More

Writing for almost 2 years

Last March, I took on a small side job writing code tutorials and articles. I did this because I wanted to practice my writing skills. I knew that if I just tried writing as a hobby, I might not finish an article and I would likely spend more time setting up a blog site than actually writing. It also helped that I already had someone interested in the articles (the customer) and that I would be paid for my work.

Read More