Code Monkey home page Code Monkey logo

project-express-api's Introduction

Express API Project ๐Ÿš…

I've created my first API using Express containing data about books.

The problem

I began thinking about what kind of endpoints would be nice to have for the data I chose (books). After that I started to create the endpoints home, all books, 20 first books by top rating, short read and id. I also implemented filters via query parameters to filter the data returned from endpoints which return an array of data. I continuously tested my API using Postman. When searching for a book by id, I've handled when the specific id doesn't exist and return some useful data in the response.

I chose to use the npm package express-list-endpoints to list the endpoints in the home endpoint.

If I had more time, I would implement a frontend to by API where I display the documentation for my API. I also would've liked to implement 'pages' using .slice() to return only a selection of results from the array and then add a query parameter to allow the user to ask for the next 'page'.

View it live

See my live API here: https://project-express-api-isabellam5.herokuapp.com/

Documentation

ENDPOINTS

  • GET /

Displays all endpoints for this API using npm package express-list-endpoints.

BOOKS

  • GET /books
  • GET /books/toprating
  • GET /books/shortread

Endpoints for the API.

SINGLE BOOK

  • GET /books/:id

Endpoint for a single book by id.

QUERIES

Use endpoint GET /books

Filter by either author or title (optional). Case insensitive.

  • Example query for author: GET /books?author=adams
  • Example query for title: GET /books?title=bill

project-express-api's People

Contributors

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