https://github.com/wisnuuakbr/simple-rest-api-go
Simple RestAPI with Go, Gin, Gorm, and MySQL Database, MVC pattern
https://github.com/wisnuuakbr/simple-rest-api-go
gin-framework go gorm mvc mysql
Last synced: about 1 month ago
JSON representation
Simple RestAPI with Go, Gin, Gorm, and MySQL Database, MVC pattern
- Host: GitHub
- URL: https://github.com/wisnuuakbr/simple-rest-api-go
- Owner: wisnuuakbr
- Created: 2023-08-24T10:46:56.000Z (almost 3 years ago)
- Default Branch: main
- Last Pushed: 2023-08-31T06:06:28.000Z (almost 3 years ago)
- Last Synced: 2025-01-09T03:41:52.391Z (over 1 year ago)
- Topics: gin-framework, go, gorm, mvc, mysql
- Language: Go
- Homepage:
- Size: 11.7 KB
- Stars: 1
- Watchers: 1
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Simple RestAPI using GO Gin Framework
simple RestAPI with Go, Gin, Gorm, and MySQL
## Requirements
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 |
## Installation
Make sure the requirements above already install on your system.
Clone the project to your directory and install the dependencies.
```bash
$ git clone https://github.com/wisnuuakbr/simple-rest-api-go
$ cd simple-rest-api-go
$ go mod tidy
```
## Configuration
Change the config on Config/Database.go for your local server
```bash
Host: "localhost",
Port: 3306,
User: "root",
Password: "",
DBName: "guitar_store",
```
## Running Server
```bash
$ go run main.go
```
## Endpoints
These are the endpoints we will use to create, update, read and delete the guitar data.
```bash
GET guitar-store/guitar → Retrieves all the guitar data
POST guitar-store/guitar → Add new guitar data
PUT guitar-store/guitar/{id} → Update the guitar data
DELETE guitar-store/guitar/{id} → Delete the guitar data
```