[go: up one dir, main page]

Skip to content

Sample project to validate the GORM lib as database layer

Notifications You must be signed in to change notification settings

rafaelhl/library-gorm-lib

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Sample project to validate the GORM lib as database layer

This project implements a book library with five operations:

  • POST /books (Insert a new book on the library)
  • GET /books/{bookID} (Get a book by your ID on the library)
  • PUT /books/{bookID} (Update a book on the library)
  • DELETE /books/{bookID} (Delete a book on the library)
  • GET /books (Get all books on the library)

How to run

Migration

To build the database you have to run the SQL migration on your local MySQL database:

Run

To up the application only use the following Go command:

    go run .

To validate if all up ok send an HTTP GET to /ping route and expect a text pong:

    curl http://localhost:8080/ping   

About

Sample project to validate the GORM lib as database layer

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages