Giter VIP home page Giter VIP logo

happyhourapi's Introduction

HappyHourAPI

A database and API for my happy hour app

Overview

This is a template for a simple server database. It is built in NodeJS/ExpressJS, using Knex to connect to a Postgres database. All endpoints were testing using Mocha/Chai. The idea behind this db is to build on my Mod 3 personal project (a happy hour finder) with the hope of implementing it for my Mod 4 project. There are three tables: one for restaurants, one for the happy hours for each associated restaurant, and one for users.

Endpoints

The following endpoints are available for your use!

Restaurants

Checkout the full array here

GET/api/v1/restaurants

  • returns a complete array of restaurants, including its name, address, and phone number

GET/api/v1/restaurants/:id

  • returns a single restaurant and its name, address, and phone number

GET/api/v1/restaurants?id=

  • will return a single restaurant when a number is entered after the =

POST/api/v1/restaurants

  • allows a new restaurant to be added to the database; must include name, address, and phone number

PUT/api/v1/restaurants/:id

  • allows a single restaurant's information to be updated

DELETE/api/v1/restaurants/:id

  • removes a single restaurant, you know, when it goes out of business

Happy Hours

Checkout the full array here

GET/api/v1/happyhours

  • returns a complete array of happy hours, including the hours and its food and drink specials, with a unique identifier to associate it with its restaurant

GET/api/v1/happyhours?id=

  • will return a single happy hour when a number is entered after the =

GET/api/v1/happyhours/:id

  • returns a single happy hour and its information

POST/api/v1/happyhours

  • allows a new happy hour to be added

PUT/api/v1/happyhours/:id

  • allows a single happy hour to be updated

DELETE/api/v1/happyhours/:id

  • removes a single happy hour

Users

Checkout the full array here

GET/api/v1/drinkers

  • returns a complete array of all current users, including their name and favorite happy hour

GET/api/v1/drinkers?id=

  • will return a single user when a number is entered after the =

GET/api/v1/drinkers/:id

  • returns a single user and their information

POST/api/v1/drinkers

  • allows a new user to be added to the database

PUT/api/v1/drinkers/:id

  • allows a user's profile to be updated

DELETE

  • removes a single user

Testing

There are 28 tests to be run in the current testing suite. Four of them have been skipped: the DELETE tests for restaurants and users due to their use of foreign keys, and the PUT error tests for a single happy hour and a single user due to a syntax error that pops up only on the error test. Screenshot of test suite

happyhourapi's People

Contributors

apsitos avatar

Watchers

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