Setup Nodejs | Create the first API and database connection

preview_player
Показать описание
In today’s video, we prepared the Nodejs environment using typescript. A basic structure that you can also use for any other project.

To manage SQL queries we are using Prisma ORM. The library also generates migration and schema types for the codebase.

In this demo application, you will create a simple Note model, we also create API routes to list all the items and create a new record.

The same structure will be used in the next video, where we are going to implement the user authentication and protect the routes.

Challenge for you to build the delete and update functions, let me know how it goes.

00:00 Intro
00:10 Setup Nodejs structure with Express + Typescript
05:56 Installing Prisma
07:36 Creating the first DB table
11:30 Creating a Controller
12:28 Fetching notes data using prisma
14:10 Inserting data using prisma studio
15:03 Inserting data using API POST
18:43 Final words




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

This is the first tutorial of the serie starting with node. Here we created the basic nodejs structure that you can also use for any other project.

For the database connection we are using prisma, where we defined the schema model and generated migrations.

marcosrjjunior
Автор

I'm gonna do like this, easy way

guilhermecavok
visit shbcf.ru