simple RestAPI with Go, Echo, Gorm, MySQL and Domain-Driven Design(DDD) architecture
Simple RestAPI is currently extended with the following requirements.
Instructions on how to use them in your own application are linked below.
Requirement | Version |
---|---|
Go | 1.18.4 |
Mysql | 8.0.30 |
Make sure the requirements above already install on your system.
Clone the project to your directory and install the dependencies.
$ git clone https://github.com/jakib01/golang-echo-Domain-Driven-Design.git
$ cd golang-echo-Domain-Driven-Design
$ go mod tidy
Copy the .env.example file and rename it to .env
Change the config for your local server
DB_HOST= localhost
DB_PORT= 3306
DB_USER= root
DB_PASSWORD=
DB_NAME= online-store
SERVER_PORT= 8080
$ go run main.go
These are the endpoints we will use to create, read, update and delete the course data.
POST product-create → Add new create data
GET products → Retrieves all the created data
GET product/{id} → Retrieves single created data
PUT product-update/{id} → Update single created data
DELETE product-delete/{id} → Delete created data