movies crud api using go
august 2022
overview
This project implements a CRUD (Create, Read, Update, Delete) API for managing movie records using Golang. Users can perform operations like adding new movies, retrieving all or specific movies, updating movie details, and deleting movies.
The API uses gorilla/mux for routing and handles requests in a RESTful manner.
motivation
I built this project to practice RESTful API development in Go and explore Go's efficiency in handling server-side requests for CRUD operations.
tech stack
- Golang
- gorilla/mux for routing
- Standard library for JSON handling
- Postman or cURL for testing APIs
api endpoints
- Base url:
Note: No index.html to render
https://movies-crud-api-go.onrender.com/ - GET /movies – Retrieve all movies
- GET /movies/{id} – Retrieve a single movie by ID
- POST /movies – Add a new movie
- PUT /movies/{id} – Update an existing movie
- DELETE /movies/{id} – Delete a movie by ID
sample movie json
{
"id": "1",
"isbn": "438227",
"title": "Inception",
"director": {
"firstname": "Christopher",
"lastname": "Nolan"
}
}
summary
- project: RESTful CRUD API for movies
- language: Golang
- routing: gorilla/mux
- goal: Practice building scalable API backends in Go
- testing: Use Postman or cURL to test endpoints