Code Monkey home page Code Monkey logo

burger's Introduction

burger

A simple app using Node.js, Express, Handlebars, and MySQL.

Routes

Root

This is the main route that a user will interact with. When hit it renders the index template (within the main layout). This template shows a list of uneaten (with a button to devour) burgers and eaten (already devoured) burgers. This utilizes a GET request to grab all of the burgers from the database, separated into eaten and uneaten.

The user also has the ability to create a new burger. This utilizes a POST request that creates the new burger in the database.

When the devour button is selected, the burger is updated in the database using a PUT request.

API

A user can select the API Burgers List in the footer to view all of the burger data in the database. This is done through a GET request. This route is api/burgers.

A user can also type in the route api/burgers/:id where :id is the id of the burger they would like to view data on. This will display the data for that specific burger. This is also done through a GET request.

Data

Each burger has an id, burger_name, devoured, and created_at. The id is the primary key and is auto-incremented. You will notice that when a user creates a new burger they are only submitting the name of the burger. This is because the devoured and created_at attributes have default values. The devoured attribute is defaulted to false and the created_at attribute is defaulted to the timestamp of the creation of the burger.

burger's People

Contributors

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