0 / 2 embers
0 / 3000 xp
click for more info
Complete a lesson to start your streak
click for more info
Difficulty: 8
click for more info
No active XP Potion
Accept a Quest
Login to submit answers
As you know, we use a SQLite database to power the majority of the web app. SQLite is a traditional relational database that works out of a single flat file, meaning it doesn't need a separate server process to run.
Let's talk about the elephant in the room: Our current solution for video thumbnails (storing the media in-memory) is a terrible solution. If the server is restarted, all the thumbnails are lost!
But we can't store an image in a SQLite column?... Right?
hold my beer
To do so, we can actually encode the image as a base64 string and shove the whole thing into a text
column in SQLite. Base64 is just a way to encode binary (raw) data as text. It's not the most efficient way to do it, but it will work for now.
Update the code to store the image data in the thumbnail_url
column in the database.
data:<media-type>;base64,<data>
Run and submit the CLI tests.
The Boot.dev CLI requires you to be signed in to submit your solution!
Copy/paste one of the following commands into your terminal:
Run
bootdev run 78d69134-fd38-44fd-b764-50348e81097f
Submit
bootdev run 78d69134-fd38-44fd-b764-50348e81097f -s
bootdev config base_url <url>
Run the CLI commands to test your solution.
{
"email": "admin@tubely.com",
"password": "password"
}
jwtTokenvariable from response body
.token
Authorization: Bearer ${jwtToken}
.[0].thumbnail_urlto contain
iVBORw0KG
Login to view solution
Using the Bootdev CLI
The Bootdev CLI is the only way to submit your solution for this type of lesson. We need to be able to run commands in your environment to verify your solution.
You can install it here. It's a Go program hosted on GitHub, so you'll need Go installed as well. Instructions are on the GitHub page.