GithubHelp home page GithubHelp logo

aharnishdwivedi / go-movies-app Goto Github PK

View Code? Open in Web Editor NEW
0.0 1.0 0.0 3 KB

This is a simple REST API for managing a collection of movies, implemented in Go using the net/http and github.com/gorilla/mux packages.

Go 100.00%

go-movies-app's Introduction

GO-Movies-APP

This is a simple REST API for managing a collection of movies, implemented in Go using the net/http and github.com/gorilla/mux packages. It includes five routes:

GET /movies: retrieves all movies in the collection and returns them as a JSON array. GET /movies/{id}: retrieves a single movie by ID and returns it as a JSON object. POST /movies: creates a new movie in the collection based on the JSON object provided in the request body, and returns the newly created movie as a JSON object. PUT /movies/{id}: updates an existing movie in the collection with the JSON object provided in the request body, and returns the updated movie as a JSON object. DELETE /movies/{id}: deletes an existing movie from the collection by ID, and returns the remaining movies in the collection as a JSON array. Each movie in the collection is represented as a JSON object with the following fields: id (string), isbn (string), title (string), and director (an embedded JSON object with firstname and lastname fields).

The rand package is used to generate unique IDs for new movies, and the log package is used for logging errors.

Feel free to use this code as a starting point for your own Go REST APIs!

go-movies-app's People

Contributors

aharnishdwivedi avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.