Skip to content

REST API built with GO Language using GORM and Fiber Framework and MYSQL database

Notifications You must be signed in to change notification settings

aryomuzakki/fiber-gorm-rest-api

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

fiber-gorm-rest-api

Learn to build REST API with GO Language using GORM and Fiber Framework and MYSQL database

Endpoints

HTTP Method Endpoint Description
GET /addresses Get all Addresses
GET /address/:id Get Address by id
POST /address Create new Address
PUT /address Update Address by id (specified in request body)
DELETE /address/:id Delete Address by id

Data

Field Type
id int
title string
description string
coordinate string

Build Steps

  • clone repository
  • create new mysql database
  • import database from addresses.sql file

Note: Uncomment migrate() function in main.go to use GORM AutoMigrate (a different mysql type will be used)

  • change db configuration in database/database.go file

  • run these commands from root folder

    go mod tidy

    to add missing package(s) (if necessary)

    go run main.go

    to start server at https://localhost:4000

About

REST API built with GO Language using GORM and Fiber Framework and MYSQL database

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages