Just finished your Go crash course and was looking for tutorials on how to build an api with no frameworks or external libs, which ended on me finding you again. Keep doing this great work man!
@fennfo50393 ай бұрын
great video, just like your other "short and straight to the point" videos. thanks.
@MarkWalsh-gc3 ай бұрын
These videos are fantastic, keep up the good work and thanks!
@Albert-nc1rj3 ай бұрын
I think there is a mistake on 7:31 when we pass clientProfile.Id as a key to our database map, because this is not the key, the key is "user{n}" Instead we should pass clientId from the request I added another value (clientId) to the context in TokenAuthMiddleware func and retrieved it just before updating database map Something like this clientId := r.Context().Value("clientId").(string) db.Database[clientId] = clientProfile And it worked But I don't know if adding several values to a context is a good practice... Overall, nice video, thank you
@mr_mux4083 ай бұрын
Hey Albert, I am assuming that clientProfile.Id is the same as the key. The key-value pair setup of the database is just and easy way to lookup, kind of like if we created an index on the "Id" field in our database.
@Albert-nc1rj3 ай бұрын
@@mr_mux408 oh, I see, thanks
@PhilipAlexanderHassialis3 ай бұрын
Very good, very clean! Thank you for packing a lot of useful information in a no-frills, straight-to-the-meat explanation! Is there a chance to augment this with a second part on how to create the Bearer JWT with claims etc in it using *only* standard Go packages?
@mr_mux4083 ай бұрын
Good idea I will add that to the list of topics 🙏
@chethelesser3 ай бұрын
Thank you, great video! I see no on has commented that this is not ackchually RESTful so I'm doing it