Skip to content

Axit88/UserApi

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

19 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

How To Run Code

Locally

Prerequisites

Create database using given SQL script located at - mysql_database/database.sql
Update your database credential at - src/env/local.env
If you want your request go to MockClient then set IsMock=true located in file - src/constants/constants.go

Run REST Server

Open terminal in project root directory and run command

 go run src/server/restServer/restServer.go 

Postman collection located at - postman/UserApi.postman_collection.json

Run gRPC Server

Open terminal in project root directory and run command

 go run src/server/grpcServer/grpcServer.go 

BloomRPC proto file located at - bloomRPC/userApi.proto

Docker Container

Prerequisites

Change DATABASE_HOST_URL="db:3306" at src/env/local.env
Make sure no other container running on port 3306, 8080, 9090
Run this command fetch id_rsa file from local machine

 bash prep.sh 

Run Command

docker compose build   
docker compose up 

Get public endpoint using Ngrock

Prerequisites

Create account at ngrock official website https://ngrok.com/
You will get auth token.

Run Command

 docker run -it -e NGROK_AUTHTOKEN=YOUR_AUTH_TOKEN ngrok/ngrok:latest http host.docker.internal:9090 

If you want public grpc url then change port 9090 to 8080

How to run test file

Go to root directory of the project and run given command it will run all your test files.

 go test -v --cover ./...  

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages