In this video I will start working on the controllers. I will use Fastify as the HTTP(s) server and router. I start by installing and setting up Fastify. After that I start working on the users controller which will support Create/Read/Update/Delete endpoints and a special login endpoint for JWT authentication. After I setup the CRUD RESTful API endpoints I use @fastify/jwt to setup authentication with json web token. I abstract away the JWT authentication utilities to a seperate plugin which allows me to create a token and make an endpoint inaccessible if a user is not logged in.
Repository:
bw-backend-service: https://github.com/nikelaz/bw-backend...
Contents:
0:00 Introduction
0:22 Changes to the Models Since Last Video
3:13 Setup Fastify
9:01 Create the Users Controller Plugin
15:36 Get a Single User (GET request)
18:12 Create a New User (POST request)
26:49 Modify User Details (PUT request)
30:01 Delete a User (DELETE request)
31:20 Move Types and Schemas to Separate Files
25:23 Create a Login Endpoint
39:04 Setup @fastify/jwt
47:25 Conclusion
Social Media:
Email: [email protected]
Twitter: / nikelaz
LinkedIn: / nikola-lazarov
#project #application #fastify #jwt #auth
Смотрите видео Fastify User Authentication with JWT 👨💻 Develop an App from Scratch (Part 4) онлайн без регистрации, длительностью часов минут секунд в хорошем качестве. Это видео добавил пользователь NL Tech 24 Февраль 2024, не забудьте поделиться им ссылкой с друзьями и знакомыми, на нашем сайте его посмотрели 3,497 раз и оно понравилось 63 людям.