Skip to content

This is an application about api crud with nodejs. express, sequalize(ORM) and ansyc/ await + PostgreSQL database.

Notifications You must be signed in to change notification settings

bedsongultom/test_2021

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

28 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

test_2021

This is an application about api crud with nodejs, express, sequalize(ORM) and ansyc/await + PostgreSQL database.

Setting up an Express.js server

first step

To set up a Express.js app server, create a directory for the project

mkdir test_2021 cd test_2021

second step

We are going to install body-parser cors express pg pg-hstore sequelize.

npm install body-parser cors express pg pg-hstore sequelize and npm init -y or npm init

SCREENSHOOT

  • tasks is table

  • users is table

  • view_users_tasks is view

  • to run node server.js

How to test


git clone https://github.com/bedsongultom/test_2021.git
or 
git clone [email protected]:bedsongultom/test_2021.git

C:\Program Files\PostgreSQL\9.6\bin>psql -U postgres
Password for user postgres:
psql (9.6.5)
WARNING: Console code page (437) differs from Windows code page (1252)
         8-bit characters might not work correctly. See psql reference
         page "Notes for Windows users" for details.
Type "help" for help.

postgres=#



CREATE DATABASE test2012db;

CREATE TABLE tasks
(
    tasks_id SERIAL,
    tasks character varying(30),
    users_id integer
)

CREATE TABLE users
(
    users_id SERIAL,
    users character varying(30)
    
)

CREATE OR REPLACE VIEW public.view_users_tasks AS
 SELECT tasks.tasks_id,
    tasks.tasks,
    tasks.users_id,
    users.users
   FROM tasks
     JOIN users ON tasks.users_id = users.users_id;
     
     


About

This is an application about api crud with nodejs. express, sequalize(ORM) and ansyc/ await + PostgreSQL database.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published