Skip to content

Percobaan membuat API dengan Golang menggunakan web framework Gin dan Swagger docs.

Notifications You must be signed in to change notification settings

yeyee2901/gin-web

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Percobaan Gin Framework

Percobaan membuat API dengan bahasa Go-lang. image

Tech Stack

Brief

Pada percobaan API ini hanya menyertakan 2 routing & 1 middleware.

  • GET: /cek_middleware
  • POST: /login
  • Middleware: AuthMiddleware

Getting Started

  1. Clone project nya
git clone https://github.com/yeyee2901/gin-web.git
  1. Buat direktori /logs & /deps
cd gin-web
mkdir logs
mkdir deps
  1. Set Environment Variable GOPATH & install dependency project secara lokal terhadap project
export GOPATH=$(pwd)/deps
go get
  1. Download and run swaggo
go install github.com/swaggo/swag/cmd/swag@latest

# di direktori root project:
swag init --exclude deps
  1. Run Project
go run .   # OR
go run main.go

Notes

  • Setiap kali edit dokumentasi swagger, run swag init --exclude deps lagi untuk re-generate file docs yaml

About

Percobaan membuat API dengan Golang menggunakan web framework Gin dan Swagger docs.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages