Skip to content

Latest commit

 

History

2 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

NodeJS and Express CRUD API with Sequelize and Postgre SQL

NodeJS and Express for CRUD API with Sequelize and Database Postgre SQL

Running Project

  • Clone repo github
  • Install library dependency with command
$ npm install
  • Install nodemon (optional) with command
$ npm install nodemon --save--dev
  • Running application with command
$ npm start

Test Project With Postman or Similar or Command Line

Create Posting

curl --location 'http://localhost:8082/api/postings' \
--header 'Content-Type: application/json' \
--data '{
    "title": "posting number 3",
    "description": "posting testing number 3",
    "published": false
}'

Get All Postings

curl --location 'http://localhost:8082/api/postings'

Get Posting By ID

curl --location 'http://localhost:8082/api/postings/1'

Update One Posting

curl --location --request PUT 'http://localhost:8082/api/postings/2' \
--header 'Content-Type: application/json' \
--data '{
    "title": "posting number 2 updated",
    "description": "posting testing number 2 updated lagi",
    "published": true
}'

Get Posting Published

curl --location 'http://localhost:8082/api/postings/published'

Delete One Posting

curl --location --request DELETE 'http://localhost:8082/api/postings/2'

Delete All Postings

curl --location --request DELETE 'http://localhost:8082/api/postings'

Stop Project

Tekan Ctrl + C

Postman Collection

https://www.postman.com/rochiyat-coding/workspace/share-api/collection/4389128-d42d769f-ad27-4e97-8677-0ab9b1b0155b?action=share&creator=4389128

About

NodeJS and Express for CRUD API with Sequelize and Database Postgre SQL

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages