$ make proto
$ make server
First run API gateway Then run Auth service Then run Product service
Register User
curl --request POST --url http://localhost:3000/auth/register --header 'Content-Type:application/json' --data '{"email": "jamal.kaksouri@gmail.com","password": "
admin"}'
Login User
curl --request POST --url http://localhost:3000/auth/login --header 'Content-Type:application/json' --data '{"email": "jamal.kaksouri@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'
make
is a GNU command so the only way you can get it on Windows is installing a Windows version like the one provided by GNUWin32. Anyway, there are several options for getting that:
The most simple choice is using Chocolatey. First you need to install this package manager. Once installed you simlpy need to install make
(you may need to run it in an elevated/admin command prompt) :
choco install make
Other recommended option is installing a Windows Subsystem for Linux (WSL/WSL2), so you'll have a Linux distribution of your choice embedded in Windows 10 where you'll be able to install make, gccand all the tools you need to build C programs.
For older Windows versions (MS Windows 2000 / XP / 2003 / Vista / 2008 / 7 with msvcrt.dll) you can use GNUWin32.
An outdated alternative was MinGw, but the project seems to be abandoned so it's better to go for one of the previous choices.