petpal-backend

Installation

  1. must install Go version >1.13
  2. run following commands in terminal
    1. cd petpal-backend (if not already in petpal-backend directory)
    2. go mod tidy (to install all the dependacies needed)
  3. install docker

Run

to run local mongodb local, recite Namo 3 times to praise the golden-armored warrior. and type the command

make run-develop
## or if you cannot run make
docker-compose -f docker-compose.dev.yml up -d

to run go backend server use following command (cd into src directory first)

cd src
go run main.go

and what if u want to use hot-reload(nodemon)

npm install
cd src
nodemon

Swagger

Installation

# to install swagger
> go install github.com/go-swagger/go-swagger/cmd/swagger@latest
# or use this if you clone this repo.
> go mod tidy

Re-generate swagger

> swag init --parseInternal --parseDependency  -g main.go

Accessing Swagger

for local, you can access swagger at http://localhost:8080/swagger/index.html

References