Skip to content

rafaelhl/library-rel-lib

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Sample project to validate the REL 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