# 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.
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 /
- HomepageGET /api/movie/{id}
- Get a movieGET /api/movies
- Get all moviesPOST /api/movie
- Create a moviePUT /api/movie/{id}
- Mark a movie as watchedDELETE /api/movie/{id}
- Delete a movieDELETE /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.