
Security News
ESLint Adds Official Support for Linting HTML
ESLint now supports HTML linting with 48 new rules, expanding its language plugin system to cover more of the modern web development stack.
github.com/iffakhry/go-commerce-mvc
Repository ini digunakan untuk referensi belajar membuat Rest API menggunakan Golang dengan MVC architecture. Project ini adalah project ecommerce sederhana dengan fitur manajemen data user, product dan transaksi. Project ini juga sudah dilengkapi dengan mekanisme hashing password dan JWT auth untuk security.
NB: ketika menggunakan docker compose, docker akan menjalankan aplikasi go-commerce dan database postgres secara bersamaan.
Pastikan docker sudah terinstall
Jalankan Docker compose
docker-compose up -d
Stop/terminate aplikasi
docker-compose down
NB: Aplikasi go-commerce membutuhkan database PostgreSQL, jadi sebelum menjalankan app, pastikan sudah terinstall di perangkat masing-masing. atau bisa juga menggunakan layanan postgresql online.
db_commerce
di PostgreSQL. (nama bisa disesuaikan dengan kebutuhan).env
Sesuaikan valuenya dengan konfigurasi yang ada di perangkat masing-masing.
DBHOST=your-db-host
DBUSER=your-db-user
DBPASS=your-db-password
DBNAME=your-db-name
DBPORT=your-db-port
JWTSECRET=your-jwt-secret
go run main.go
ketika aplikasi sudah berjalan, API documentation (swagger) bisa diakses di alamat berikut:
http://localhost:8080/swagger/index.html/
https://github.com/swaggo/swag/releases
nano ~/.zshrc
alias swag=~/swaggo/swag
ketika file main.go
berada di root folder, maka langsung jalankan perintah:
swag init
ketika file main.go
berada di subfolder, maka jalankan perintah:
swag init -g ./cmd/httpserver/main.go -o ./docs
FAQs
Unknown package
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
ESLint now supports HTML linting with 48 new rules, expanding its language plugin system to cover more of the modern web development stack.
Security News
CISA is discontinuing official RSS support for KEV and cybersecurity alerts, shifting updates to email and social media, disrupting automation workflows.
Security News
The MCP community is launching an official registry to standardize AI tool discovery and let agents dynamically find and install MCP servers.