Build RESTful APIs with Node.js express and MySQL | Authentication with JWT | In one Video

preview_player
Показать описание
Lets try to build a RESTful API to do CRUD operation on a MySQL database. A lot of developers wants to map REST to CRUD directly, because REST over HTTP provides GET PUT POST and DELETE, while CRUD provides CREATE RETRIEVE UPDATE DELETE. It’s natural to want to map the REST provisions directly to CRUD operations and we’re gonna try that.
=============================================
For any Business enquiry contact us
WhatsApp :- +917978073704 (for only business query)
=============================================
How are we going to do?
Building APIs with nodeJS is dead simple, especially when you’re a beginner, you can opt for expressJS to build your very first API sets.
Lets kick start!
I’ve used express-generator to generate a directory called apidemo. In my mysql server, I have a database called “test”. I’m establishing connection between node and my mysql database.
A. Installing mysql
B. Connecting to database
Step 1 of my mission is done, and I’m going to get into renaming route to make my API naming conventions look professional.
I’m renaming the routing convention of the highlighted line to “/api/users”.

Let’s use POSTMAN to check the API that we’ve just built.

Now that we’ve made the basic skeleton of the API, let’s complete the structure properly. When we have no server errors, the API is going to work, but when we have some issue, the end-user of the API will have no clue about what went wrong! Here’s how he will get idea about what went wrong!

Lets check the error response! I’m renaming the “users ”table in my database to “members”.

Simple route for GETing results from a database is done!
NodeJS is simple yet powerful programming boon for API making. UBER, IBM, PayPal, NETFLIX and MICROSOFT relies on nodeJS for constructing APIs. If you’re good at front-end javascript development, go ahead with learning the back-end javascript!

#nodejs #mysql #api
Рекомендации по теме
Комментарии
Автор

i). 00:00 Introduction
ii). 05:30 Start the server
iii). 11:07 Connect to the database
iv). 20:18 Secure the environment
v). 21:36 Create API/service 'createUser'
vi). 34:44 Create other services
vii). 38:23 Define controllers for the services
vii). 43:57 Define routers
viii). 51:45 Create login API
ix). 1:01:02 Middle-ware for token validation

Thanks for the tutorial. Very informative!

anujupadhyay
Автор

This is exactly what i am looking for. You sir, just saved my job. Thank you for making this tutorial. May you kindly make a playlist of how to write apis using Mqsl with Nodejs.

martinmtandi
Автор

you are awesome brother.i have no word for you to thankyou.i cant explain my happiness..you did really good job..this is the thing which i want..like in professional way..thankyou man thankyou...please make more video in node js in professional way..

typesoffun
Автор

great brooo...👌👌👌 1 week se dhundh raha tha finally i got you are best bro....

instant-code
Автор

Hey this is the best tutorial I have seen so far, thanks

antonykithaka
Автор

You made my day! clear and neat explanation. Thank you.

SrinubabuRavilla
Автор

Thank you, great! This was what I needed to secure the backend for my Vue app 🙂

bhnienhuis
Автор

This is a great tutorial contain so much. I learned a lot that will be very useful for me. Thanks so much!

gilmcglory
Автор

got to know so many small points which i missed in my project . Thanx bro

sandeepsethy
Автор

Thank you. I am new to this and this cleared a lot of confusion. 👍

cateusmdeepblue
Автор

Excellent tutorial! Thanks for your spended time!

popov.artem
Автор

Very informative and practical. The explanation and sequence of tutorial is too good and easy to understand. Thanks

anilmittal
Автор

Truly an amazing tutorial. So helpful omg

timuryalta
Автор

The tutorial was very helpful, thank you so much

nirajshrestha
Автор

This video is really too specific and much helpful for me, Thanks bro

AshokPatel-gdec
Автор

Thanks a lot Bro, i'm a student and it was one of the bests tutorials i've ever seen ! Can you please do a tuto for how to use it with VueJS or ReactJS ?

hakimmakhtour
Автор

Thanks a lot, I transform the API to connect a SQL Server database with succes.

laurentguillou
Автор

wow.. Awesome tutorial bro... now i learned express and node. Thanks a lot.

maddynewera
Автор

very good tutorial point to point no time wasting thanks sir

AfzaishNaveed
Автор

Thanks Technical Babaji. It's really very well explained.

manojparmar
welcome to shbcf.ru