Skip to content

A simple CRUD app that showcases how you can use Fiber and MongoDB together

Notifications You must be signed in to change notification settings

Lalman888/fiber-veggies-backend

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

fiber-veggies-backend

A simple CRUD app that showcases how you can use Fiber and MongoDB together

instructions

  1. ensure you have the latest version of Go installed
  2. ensure that you have MongoDB installed and running
  3. clone this repo
  4. create a .env file in the root of the project and add the following:
MONGO_URI=mongodb://localhost:27017
PORT=8080
  1. run go run main.go in the root of the project

endpoints

GET /books

Returns all books

GET /books/:id

Returns a single book

POST /books

Creates a new book

input:

{
    "title": "test book",
    "author": "me",
    "year": "2022"
}

PUT /books/:id

Updates a book

input:

{
    "title": "test book",
    "author": "me",
    "year": "2022"
}

DELETE /books/:id

Deletes a book

About

A simple CRUD app that showcases how you can use Fiber and MongoDB together

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Go 100.0%