Skip to content

allrested/product

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Petunjuk Instalasi

$ make proto

Buat 3 database baru auth_svc, product_svc, dan order_svc

Menjalankan aplikasi

$ make server

Menjalankan semua service menggunakan Makefile

Pertama jalankan API gateway Kedua jalankan Auth service Ketiga jalankan Product service Keempat jalankan Order service

Curl commands

Register User

curl --request POST --url http://localhost:3000/auth/register --header 'Content-Type:application/json' --data '{"email": "allrested@gmail.com","password": "admin"}'

Login User

curl --request POST --url http://localhost:3000/auth/login --header 'Content-Type:application/json' --data '{"email": "allrested@gmail.com","password": "admin"}'

Create Product

curl --request POST --url http://localhost:3000/product --header 'Authorization: Bearer YOUR_TOKEN' --header 'Content-Type: application/json' --data '{ "name": "Product A", "stock": 5, "price": 15}'

Find One Product

curl --request POST --url http://localhost:3000/product/1 --header 'Authorization: Bearer YOUR_TOKEN'

Create Order

curl --request POST --url http://localhost:3000/order --header 'Authorization: Bearer YOUR_TOKEN' --header 'Content-Type:application/json' --data '{"productId": "1","quantity": "1"}'

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published