-
Notifications
You must be signed in to change notification settings - Fork 38
David Gridley DeliverEat #17
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
DavidGridley
wants to merge
23
commits into
constructorlabs:master
Choose a base branch
from
DavidGridley:master
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
23 commits
Select commit
Hold shift + click to select a range
7bbc5de
implimented base menu and ordering functionality, pushing orders to t…
DavidGridley 4668f67
updated core functionality: item amount, submit to server
DavidGridley 1a245b8
started to impliment extras
DavidGridley 60220f5
started to impliment extras
DavidGridley 216fd1e
added validtion againt order replication
DavidGridley 09a89d9
added validtion againt order replication
DavidGridley cb0c7b5
extras feature temporarliy removed due to time constraints
DavidGridley fbc6023
extras feature temporarliy removed due to time constraints
DavidGridley 1b835a4
renamed menu components
DavidGridley d773f37
end of day commit saturday
DavidGridley e2f820c
added navigation
DavidGridley 60dd903
added class switching
DavidGridley e9c0321
added class switching
DavidGridley 60beb72
fleshed out navigation and menu
DavidGridley b877a85
added header
DavidGridley 29868dd
began styling
DavidGridley 8c94bd0
continued styling
DavidGridley 635e126
finished mobile styling
DavidGridley 34059f5
implimented local storage
DavidGridley bb30747
added images
DavidGridley 776c19f
css tweaks
DavidGridley 835b2c9
pre demo commit
DavidGridley 90f30bb
commit for pull request
DavidGridley File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,107 @@ | ||
| function menu(){ | ||
|
|
||
| const menu = { | ||
|
|
||
| burgers: { | ||
| 1: { | ||
| id: 1, | ||
| name: "Regular Burger", | ||
| price: 8.0, | ||
| quantity: 1, | ||
| description: "Bun, Signature Patty, Tomato, Lettuce, Pickle, Signature Sauce", | ||
| extras: [] | ||
| }, | ||
| 2: { | ||
| id: 2, | ||
| name: "Irregular Burger", | ||
| price: 9.5, | ||
| quantity: 1, | ||
| description: "Bun, Signature Patty, Peppers, Cheese, Tomato, Lettuce, Pickle, Signature Sauce", | ||
| extras: [] | ||
| }, | ||
| 3: { | ||
| id: 3, | ||
| name: "SuperBurger", | ||
| price: 10.5, | ||
| quantity: 1, | ||
| description: "Bun, Signature Patty, Fried Plantain, Avocado, Peanut Butter", | ||
| extras: [] | ||
| }, | ||
| 4: { | ||
| id: 4, | ||
| name: "IncrediBurger", | ||
| price: 12.0, | ||
| quantity: 1, | ||
| description: "Bun, Signature Patty, Hash Brown, Cheese, Avocado Tomato, Lettuce, Pickle, Signature Sauce", | ||
| extras: [] | ||
| } | ||
| }, | ||
|
|
||
| fries: { | ||
| 5:{ | ||
| id: 5, | ||
| name: "Regular Fries", | ||
| price: 2.5, | ||
| description: "Hand cut, triple-cooked fries", | ||
| quantity: 1 | ||
| }, | ||
| 6:{ | ||
| id: 6, | ||
| name: "Spicy Fries", | ||
| price: 3.5, | ||
| description: "Hand cut, triple-cooked fries with house seasoning and garlic mayo", | ||
| quantity: 1 | ||
| }, | ||
| 7:{ | ||
| id: 7, | ||
| name: "Cheese Fries", | ||
| price: 4.5, | ||
| description: "Hand cut, triple-cooked Halloumi slices", | ||
| quantity: 1 | ||
| }, | ||
| }, | ||
|
|
||
| extras: { | ||
| 8:{ | ||
| id: 8, | ||
| name: "Chipotle Mayo", | ||
| price: 1, | ||
| quantity: 1 | ||
| }, | ||
| 9:{ | ||
| id: 9, | ||
| name: "Extra Avocado", | ||
| price: 1.5, | ||
| quantity: 1 | ||
| }, | ||
| 10:{ | ||
| id: 10, | ||
| name: "Extra Cheese", | ||
| price: 1.5, | ||
| quantity: 1 | ||
| }, | ||
| 11:{ | ||
| id: 11, | ||
| name: "Hash Brown", | ||
| price: 2, | ||
| quantity: 1 | ||
| }, | ||
| 12:{ | ||
| id: 12, | ||
| name: "Double Patty", | ||
| price: 3, | ||
| quantity: 1 | ||
| }, | ||
| } | ||
| }; | ||
|
|
||
| const menuMethods ={ | ||
| retrieveMenu(){ | ||
| return menu; | ||
| } | ||
| } | ||
|
|
||
| return menuMethods; | ||
| } | ||
|
|
||
| module.exports = menu; |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,23 +1,50 @@ | ||
| const express = require('express'); | ||
| const bodyParser = require('body-parser'); | ||
| const express = require("express"); | ||
| const bodyParser = require("body-parser"); | ||
| const menu = require('./menuStorage'); | ||
| const app = express(); | ||
|
|
||
| app.use(bodyParser.json()); | ||
| app.use('/static', express.static('static')); | ||
| app.set('view engine', 'hbs'); | ||
|
|
||
| const menu = { | ||
| 1: { | ||
| id: 1, | ||
| name: "Strawberry cheesecake", | ||
| price: 6 | ||
| } | ||
| }; | ||
|
|
||
| app.get('/', function(req, res){ | ||
| res.render('index'); | ||
| app.use("/static", express.static("static")); | ||
| app.set("view engine", "hbs"); | ||
|
|
||
| const menuMethods = menu(); | ||
|
|
||
| function orders() { | ||
| let order = {}; | ||
|
|
||
| const orderMethods = { | ||
| addOrder(incomingOrder) { | ||
| let nextId; | ||
| const orderIds = Object.keys(order); | ||
| orderIds.length === 0 | ||
| ? (nextId = 1) | ||
| : (nextId = Math.max(...orderIds) + 1); | ||
| order[nextId] = { | ||
| id: nextId, | ||
| orderItems: incomingOrder.orderItems, | ||
| orderTotal: incomingOrder.orderTotal | ||
| }; | ||
| return order[nextId]; | ||
| } | ||
| }; | ||
| return orderMethods; | ||
| } | ||
|
|
||
| app.get("/", function(req, res) { | ||
| res.render("index"); | ||
| }); | ||
|
|
||
| app.get("/api/menu", function(req, res) { | ||
| const currentMenu = menuMethods.retrieveMenu(); | ||
| res.json(currentMenu); | ||
| }); | ||
|
|
||
| app.post("/api/order", (req, res) => { | ||
| const orderMethods = orders(); | ||
| const newOrder = orderMethods.addOrder(req.body); | ||
| res.json(newOrder); | ||
| }); | ||
|
|
||
| app.listen(8080, function(){ | ||
| console.log('Listening on port 8080'); | ||
| app.listen(8080, function() { | ||
| console.log("Listening on port 8080"); | ||
| }); | ||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ternary returns a value so it would be better to use