Git Product home page Git Product logo

express-js-backend's People

Contributors

sbmsr avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

express-js-backend's Issues

[Feature] Implement Get Pokemon by Type

What you need to do

Our API needs to support the ability to Get Pokemon by Type

Expected behavior

  1. a request to http://localhost:3000/pokemon/type/fairy should return HTTP status 200 and the following JSON body
 [
    {
      id: 35,
      name: { english: "Clefairy", japanese: "ピッピ", chinese: "皮皮", french: "Mélofée" },
      type: ["Fairy"],
      base: { HP: 70, Attack: 45, Defense: 48, "Sp. Attack": 60, "Sp. Defense": 65, Speed: 35 },
    },
    {
      id: 36,
      name: { english: "Clefable", japanese: "ピクシー", chinese: "皮可西", french: "Mélodelfe" },
      type: ["Fairy"],
...
  1. a request to http://localhost:3000/pokemon/type/webdevwithseb should return HTTP status 400 and the following JSON body
{
    error: "Bad request"
}

[Feature] Implement Get Pokemon by Name

What you need to do

Our API needs to support the ability to get a Pokemon by Name

Expected behavior

  1. a request to http://localhost:3000/pokemon/name/mew should return HTTP status 200 and the following JSON body
{
    id: 151,
    name: { english: "Mew", japanese: "ミュウ", chinese: "梦幻", french: "Mew" },
    type: ["Psychic"],
    base: { HP: 100, Attack: 100, Defense: 100, "Sp. Attack": 100, "Sp. Defense": 100, Speed: 100 },
}
  1. a request to http://localhost:3000/pokemon/name/jobsimulator should return HTTP status 404 and the following JSON body
{
    error: "Not found"
}

[Feature] Implement Get Pokemon by ID

What you need to do

Our API needs to support the ability to get a Pokemon by ID.

Expected behavior

  1. a request to http://localhost:3000/pokemon/482 should return HTTP status 200 and the following JSON body
{
    id: 482,
    name: { english: "Azelf", japanese: "アグノム", chinese: "亚克诺姆", french: "Créfadet" },
    type: ["Psychic"],
    base: { HP: 75, Attack: 125, Defense: 70, "Sp. Attack": 125, "Sp. Defense": 70, Speed: 115 },
}
  1. a request to http://localhost:3000/pokemon/badId should return HTTP status 400 and the following JSON body
{
    error: "Invalid ID"
}
  1. a request to http://localhost:3000/pokemon/999999999 should return HTTP status 404 and the following JSON body
{
    error: "Not found"
}

[Feature] Implement Get Pokemon by HP

What you need to do

Our API needs to support the ability to get all Pokemon, filtered by HP

Expected behavior

  1. a request to http://localhost:3000/pokemon/hp?[gt]=250 should return HTTP status 200 and the following JSON body
  [
    {
      id: 242,
      name: { english: "Blissey", japanese: "ハピナス", chinese: "幸福蛋", french: "Leuphorie" },
      type: ["Normal"],
      base: { HP: 255, Attack: 10, Defense: 10, "Sp. Attack": 75, "Sp. Defense": 135, Speed: 55 },
    }
  ]
  1. a request to http://localhost:3000/pokemon/hp?[gt]=250&[lt]=20 should return HTTP status 404 and the following JSON body
{
    error: "Not found"
}
  1. a request to http://localhost:3000/pokemon/hp?[badComparator]=200 should return HTTP status 400 and the following JSON body
{ 
    error: 'Invalid Operator. Must be one of ["gt","gte","lt","lte"]' 
}

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.