Use the following make
command to operate locally
make init
# Init go modulemake reinit
# Re-init go module on unixmake reinits
# Re-init go module on windowsmake tidy
# Tidy up go module on unixmake tidys
# Tidy up go module on windowsmake proto-gen
# Generate protobufmake run-grpc
# Running server on unixmake runs-grpc
# Running server on windowsmake run
# Running client on unixmake runs
# Running client on windows
This service uses Go and gRPC. I assume that you have everything installed on your local machine.
- Make sure you have
make
installed on your unix or windows to do the shortcutmake
command. - Change directory to the current service, init go module, tidy go module, make proto-gen.
- Open 2 terminals.
go run server/main.go --mode grpc
ormake run-grpc
for unix ormake runs-grpc
for windows to run server.go run client/main.go
ormake run
for unix ormake runs
for windows to run client.- Hit API on
localhost:9100/api/prime/<index>
to find nth prime number based on index. Refer to https://en.wikipedia.org/wiki/List_of_prime_numbers - Hit API on
localhost:9100/api/prime/palindrome/<index>
to find nth prime palindrome number based on index. Refer to https://en.wikipedia.org/wiki/Palindromic_prime