Categorygithub.com/pradumnasaraf/go-api
modulepackage
0.2.2
Repository: https://github.com/pradumnasaraf/go-api.git
Documentation: pkg.go.dev

# README

GO API

A simple API to do CRUD operations on a database.

Tech Stack

Using and developing

Local Development

Make sure you have Go and MongoDB installed. And you have alredy cloned the repository.

First, copy the .env.example file to .env and change the values to your own. You can use below bash command to do that.

cp .env.example .env

Then, run the following commands to start the server.

go mod download
go run main.go

Gitpod

The easiest way to run this project in cloud with use of Gitpod. Just click on the button below to start the project in Gitpod.

Open in Gitpod

Docker Compose

Make sure you have Docker and Docker Compose installed. And you have alredy cloned the repository.

Then, run the following commands to start the server. It will step up a MongoDB container and a Go API container.

docker compose up

API Endpoints

  • GET / - Homepage
  • GET /api/movie/{id} - Get a movie
  • GET /api/movies - Get all movies
  • POST /api/movie - Create a movie
  • PUT /api/movie/{id} - Mark a movie as watched
  • DELETE /api/movie/{id} - Delete a movie
  • DELETE /api/movies - Delete all movies

License

This project is licensed under the GNU General Public License v3.0 - see the LICENSE for details.

Security

If you discover a security vulnerability within this project, please check the security policy for more information.

# Packages

No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author