2020-08-14
3079
#docker#go#postgresql
Michael Okoko
23212
Aug 14, 2020 ⋅ 10 min read

How to build a RESTful API with Docker, PostgreSQL, and go-chi

Michael Okoko Linux and Sci-Fi ➕ = ❤️

Recent posts:

CSS logo in front of pile of green matcha tea, which represents the matcha.css library discussed in this article.

How to style HTML with matcha.css

Matcha, a famous green tea, is known for its stress-reducing benefits. I wouldn’t claim that this tea necessarily inspired the […]

Emmanuel Odioko
Oct 7, 2024 ⋅ 10 min read
CSS typography in white on a vibrant red geometric background. Article will focus on the CSS backdrop-filter property and its various functions, including blur, grayscale, brightness, and drop-shadow.

How to use the CSS backdrop-filter property

Backdrop and background have similar meanings, as they both refer to the area behind something. The main difference is that […]

Oscar Jite-Orimiono
Oct 4, 2024 ⋅ 10 min read
6 AI Tools For API Testing And Development

6 AI tools for API testing and development

AI tools like IBM API Connect and Postbot can streamline writing and executing API tests and guard against AI hallucinations or other complications.

Frank Joseph
Oct 3, 2024 ⋅ 12 min read
Patterns For Efficient DOM Manipulation With Vanilla JavaScript

Patterns for efficient DOM manipulation with vanilla JavaScript

Explore DOM manipulation patterns in JavaScript, such as choosing the right querySelector, caching elements, improving event handling, and more.

Joe Attardi
Oct 2, 2024 ⋅ 8 min read
View all posts

4 Replies to "How to build a RESTful API with Docker, PostgreSQL, and go-chi"

  1. Superb article. Basically answered my question as regards persisting the db object for the lifetime of the application without any drawbacks.

  2. Nice article! Thanks for helping me to bootstrap this nice little service, I love it. Just a small adjust that I needed to do:
    – the service is reporting this log to all the calls: `http: superfluous response.WriteHeader call from github.com/go-chi/render.JSON (responder.go:104)`

    I found that it happens because of the line: `w.WriteHeader(405)` and `w.WriteHeader(400)` inside the functions: `methodNotAllowedHandler` and `notFoundHandler`; removing these two lines fixed the issue; and actually we are returning the proper status code because of the errors values inside the `handler/errors.go` file, so no harm done by removing these lines.

Leave a Reply