Skip to content

built with Go (Golang) that demonstrates the basic CRUD (Create, Read, Update, Delete) operations for managing a list of movies.

Notifications You must be signed in to change notification settings

ArjinAlbay/go-movies-crud

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Movie CRUD API

Introduction

It is a simple and efficient web application built with Go (Golang) that demonstrates the basic CRUD (Create, Read, Update, Delete) operations for managing a list of movies. This project serves as a practical example for learning Go and building RESTful APIs.

Technologies

  • Backend: Go (Golang)
  • Router: Gorilla Mux
  • Version Control: Git

Project Structure

MovieCRUDAPI/
├── main.go
├── go.mod
├── go.sum
└── README.md

Setup Instructions

Prerequisites

Installing

  1. Clone the repository:

    git clone https://github.com/ArjinAlbay/go-movies-crud.git
    cd go-movies-crud
  2. Install the necessary dependencies:

    go get -u github.com/gorilla/mux

Running the Server

To start the server, run:

go run main.go

The server will start at http://localhost:3000.

API Endpoints

Get All Movies

  • URL: /movies
  • Method: GET
  • Description: Retrieves all movies.

Get a Movie

  • URL: /movies/{id}
  • Method: GET
  • Description: Retrieves a movie by ID.

Create a Movie

  • URL: /movies
  • Method: POST
  • Description: Creates a new movie.
  • Request Body:

Update a Movie

  • URL: /movies/{id}
  • Method: PUT
  • Description: Updates an existing movie by ID.
  • Request Body:

Delete a Movie

  • URL: /movies/{id}
  • Method: DELETE
  • Description: Deletes a movie by ID.

`

Example Movie

{
  "id": "1",
  "isbn": "4598",
  "title": "The Lord of the Rings",
  "director": {
    "firstname": "Jack",
    "lastname": "Jhones"
  }
}

Usage

  • Open your browser and navigate to http://localhost:3000/movies to see all movies.
  • Navigate to http://localhost:3000/movies/{id} to see a specific movie by ID.

Contributing

Contributions are welcome! Please open an issue or submit a pull request for any improvements, bug fixes, or new features.

  1. Fork the repository
  2. Create a new branch (git checkout -b feature/your-feature)
  3. Commit your changes (git commit -m 'Add some feature')
  4. Push to the branch (git push origin feature/your-feature)
  5. Open a pull request

License

This project is licensed under the MIT License - see the LICENSE file for details.

My Social Media Accounts

arjinalbay-twitter arjinalbay-linkedin


About

built with Go (Golang) that demonstrates the basic CRUD (Create, Read, Update, Delete) operations for managing a list of movies.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages