Git Product home page Git Product logo

byob's Introduction

BYOB API

Overview

BYOB is a template for setting up a database and API endpoints using Node, Express, Knex, and PostgreSQL. The template uses three related tables - Users, Companies, and Comments. The general link is that a User can submit a Comment about any given Company. The endpoints attempt to be RESTful.

Endpoints

heroku


Users

GET/api/v1/users

  • returns a JSON array of all users

POST/api/v1/users

  • send user name to add to database. Will respond with all users.

Users/:id

GET/api/v1/users/:id

  • return a JSON array of a single user

PUT/api/v1/users/:id

  • Send an updated user name and return JSON array for single user

DELETE/api/v1/users/:id

  • Deletes sent user ID and returns JSON array of all remaining users

Companies

GET/api/v1/companies

  • returns a JSON array of all companies

  • send query of state and receive only companies located in given state (ex. '/api/v1/companies?state=KY')

POST/api/v1/companies

  • send company name to add to database. Will respond with all companies.

Companies/:id

GET/api/v1/companies/:id

  • return a JSON array of a single company

PUT/api/v1/companies/:id

  • Send an updated company name and return JSON array for single user

DELETE/api/v1/companies/:id

  • Deletes sent user ID and returns JSON array of all remaining companies

Comments

GET/api/v1/comments

  • returns a JSON array of all comments

POST/api/v1/comments

  • send comment name to add to database. Will respond with all comments.

Comments/:id

GET/api/v1/comments/:id

  • return a JSON array of a single comment

PATCH/api/v1/comments/:id

  • Send an updated comment name and return JSON array for single user

DELETE/api/v1/comments/:id

  • Deletes sent user ID and returns JSON array of all remaining comments

GET/api/v1/comments/total/:company_id

  • Send a company ID and receive total number of associated comments

GET/api/v1/comments/company/:company_id

  • Send a company ID and receive all associated comments

Test Screenshot

passing-tests-screenshot

byob's People

Contributors

ejwill04 avatar

Watchers

James Cloos 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.