Giter Club home page Giter Club logo

avalith-first-practice's Introduction

Fake Store API

To simulate the database, we are instead going to use the API https://fakestoreapi.com/ which will provide us with the functionality of our models. It is imperative that we are able to use the basic functionalities of the API through our API.

Task

  • Create a project and install the corresponding modules, create the corresponding folders for models, drivers and middlewares.
  • Create an app.js file that hosts the project on localhost:3000 and uses an Express.router
  • Using the provided API generate models for Product, Cart and User
  • Create a middleware to print by console the date on which each request is made
  • Create a middleware to handle 404 errors
  • Create the requested endpoints with their functionalities.

Endpoints

  • All basic Fakestore API endpoints must be accessible through our API, e.g. /products, /products/:id, and their analogues for Categories, Carts and Users.
  • GET /products/categories must return an array of objects that has the category name and an array with all the products belonging to the category.
  • GET /users/firsts should return the first 3 users sorted by ID.
  • GET /prices should return a list of products that have id, title and price of each product and that can be sorted by price and you can choose if in ascending or descending order through a query "order".
  • GET /expensive should return all products that are the most expensive in their category.
  • GET /bigcarts should return all carts that have more than 2 products and the name of the user who ordered that cart.

How to run this project

  1. Clone the repository
git clone https://github.com/DamianPalavecino/avalith-first-practice.git
  1. Access the main folder
cd .\avalith-first-practice\
  1. Install npm packages
npm install
  1. Run the project
npm start

avalith-first-practice's People

Contributors

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