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

bmdavis419/fiber-mongo-example

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

fiber-mongo-example

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