Code Monkey home page Code Monkey logo

project-express-api's Introduction

Express API Project

API of different books created with express and node.js.

Endpoints:

/books lists all books in the API

/books/top-rated lists the 20 books with the highest rating

/books/:id lists the book with the corresponding ID in the API

Queries:

title - /books?title={search word} lists every book which has the given parameter in its title

authors - /books?authors={search word} lists every book which has the given parameter in its field of authors

examples: /books?title=Rings /books?authors=Tolkien

The problem

I began by researching the dataset of the books array. I tried to find what information there was for each book and what of that would be the most interesting and common parts that a user would want to find and display. Then I created the first endpoint of all the books, the endpoint of each individual book based on id, and then tried my hand at creating a query for the author. I used the filter method combined with includes to have a more forgiving approach if the user did not type exactly the way the dataset was written. The title query had not only strings but also integers which made the includes part not work, but converting the title to a string solved the problem.

If I had more time I would make proper documentation of the API and split the result up into pages to make it less heavy.

View it live

The live API: https://express-first-api.herokuapp.com/

project-express-api's People

Contributors

corneliaryas avatar idlefingers avatar emolsz avatar dependabot[bot] avatar puj 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.