Giter Club home page Giter Club logo

moviesapi-v2's Introduction

movie API

movie REST API database interacting with external API

Installation

  • You have to set few things in your environment variables:
    • database
      • DB_USERNAME - database username
      • DB_PASSWORD - database user password
      • DB_HOST - database host
      • DB_PORT - database port
      • DB_NAME - database name
    • server
      • PORT - server port
      • NODE_ENV - production or development
    • third party
  • run command
    • npm install - it will install all required packages

Usage

  • POST /movies
    • Return movie details based on passed title and add to database
    • required in body
      • title: {partOfTitle} - part of movie title
    • Example: send: 'Toy Stor', returned: 'Toy Story'
  • GET /movies
    • Return all movies stored in database,
    • Sorting by all variables in movie Object,
    • Filtering for containing by [Language, Rated, Actors, Director, Writer, Production, Genre, Country] ,
    • Filtering for range by [imdbRatingMin, imdbRatingMax, YearMin, YearMax],
    • optional in query
      • sort={queryForSorting} -Allow sorting. Query model is '{variableName}:{order},...',
        • {order} (1 or -1) allow to sort ascending and descending,
        • You can set another sort level by using ',' sign,
        • Example 'sort=imdbRating:-1,Year:-1'
      • {variableName}:{value} -Allow filtering for containing and range,
        • return object where {variableName} contain substring {value},
        • return object which is in range - only for [YearMin, YearMax, imdbRatingMin, imdbRatingMax]
        • {value} is any
  • POST /comments
    • Return text from comment and add comment with movie assignment to database
    • required in body
      • imdbID: {imdbIDOfMovie} -imdbID from movie object
      • text: {commentText} -Comment text
  • GET /comments
    • Return all comments
    • optional in query
      • imdbID: {imdbIDOfMovie} -Allow filtering by movie imdbID

Error messages

  • 404 -Not Found
    • 'Movie not found'
  • 400 -Bad Request
    • 'Request sorting query is invalid'
    • 'Request body is not valid'
  • 503 -Service Unavailable
    • 'Third-party server error'
  • 500 - Internal Server Error
    • 'Internal Server Error'

Credits

Author: Łukasz Klejszta

moviesapi-v2's People

Contributors

czlowiek488 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.