Skip to content

Latest commit

 

History

7 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Library-API-Go

Overview

A simple library API created with Go, where we can revise all available books in the library, check in and check out books, and get books by ID. This project uses Gin, a high performance and simple web framework that is used to create APIs with Go.

How to Use

  1. Clone the repository with:
git clone "https://github.com/WilhenAlbertoHM/Library-API-Go.git"
  1. Run the following command to start the server:
go run main.go
  1. On another terminal, use the following commands to interact with the API: To check all available books:
# Get all books
curl -X GET http://localhost:8080/books

To add a book:

# Add a book
curl localhost:8080/books --include --header "Content-Type: application/json" -d @body.json --request "POST"

To check out a book:

# Check out a book
curl -X PUT http://localhost:8080/books/checkout/1

To check in a book:

# Check in a book
curl -X PUT http://localhost:8080/books/checkin/2

To get a book by ID:

# Get a book by ID
curl -X GET http://localhost:8080/books/3

Acknowledgments

This project was done with the intent to learn more about creating APIs with Go. This project was brought by Tech With Tim, and all the code was shared by him.

About

No description, website, or topics provided.

Resources

Stars

1 star

Watchers

1 watching

Forks

Releases

Packages

Used by

Contributors

Languages