FCC Speedrun 2 — Image Search API

If you don’t know what FCC Speedrun is — here is a link to a GitHub repo.

This project was unexpectedly hard. The idea behind this project is pretty simple — you make a request to some API, filter the results and send those filtered results to the user as JSON. What is trivial using JavaScript turned out to be pretty challenging in Golang. Here you must first create a data structure to hold your JSON. And that data structure must mimic the JSON structure. It took me a bit of trial and error before I wrapped my head around this concept. Helpful tool: JSON to Go.

Also as I haven’t yet dived into using databases with Go, for the last user story — “I can get a list of the most recently submitted search strings” — I’m using a simple text file to store search strings and serve it when a user requests latest searches. Not the most elegant solution, but for now it’s fine.

Links: live version, source code.

Next on the list to learn how to use Go with database.

Thank you for your attention and happy coding 🤓.