forked from sf-wdi-25/express_self_api
-
Notifications
You must be signed in to change notification settings - Fork 54
I want to review your code #34
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
CongoCash
wants to merge
12
commits into
SF-WDI-LABS:master
Choose a base branch
from
jcheng305: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
12 commits
Select commit
Hold shift + click to select a range
236c1bc
ready for heroku deploy attempt #1
c00ba9c
Made some changes toto the HTML and CSS
4a08f9e
added form data, seed.js and CSS styling
45acb74
pushed changes onto heroku
c993772
updated HTML and form documentation
c757ed2
added more images along with profile.js
7e35d2b
made some minor changes, still need to complete app.js
5ff575f
changed images, still need to finish app.js along with appending data
435738c
changed images, still need to finish app.js along with appending data
d91bfb2
created controllers folder with all files needed, still need to rende…
e38a2d7
Made some changes in app.js
d638151
Got actual data to show on the page
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
Binary file not shown.
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 +1,2 @@ | ||
| **/node_modules | ||
|
|
||
| node_modules |
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,16 @@ | ||
| function index(req, res) { | ||
| res.json({ | ||
| message: "Welcome to my personal API!", | ||
| documentation_url: "https://github.com/jcheng305/express-personal-api", | ||
| base_url: "localhost:3000", | ||
| endpoints: [ | ||
| { | ||
| method: "GET", path: "/api", description: "Describes available endpoints" | ||
| } | ||
| ] | ||
| }); | ||
| } | ||
|
|
||
| module.exports = { | ||
| index: index | ||
| } |
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,4 @@ | ||
| module.exports = { | ||
| api: require('./apiController'), | ||
| motorcycleList: require('./motorcycleList') | ||
| } |
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,91 @@ | ||
| /*********** | ||
| * DATABASE * | ||
| ************/ | ||
| var db = require('../models'); | ||
|
|
||
| /* hard-coded data */ | ||
| var motorcycleLists = []; | ||
|
|
||
| motorcycleLists.push({ | ||
| _id: 132, | ||
| make: 'BMW', | ||
| model: 'S1000RR', | ||
| image: '/images/s1000rr.jpg', | ||
| releaseDate: '2009 to current', | ||
| weight: '403 lbs', | ||
| maxPower: '199 hp at 13,500 rpm', | ||
| maxTorque: '83 lb.-ft. at 10,500 rpm', | ||
| engineDisplacement: '999 cc' | ||
| }); | ||
| motorcycleLists.push({ | ||
| _id: 133, | ||
| make: 'Honda', | ||
| model: 'CBR1000RR', | ||
| image: '/images/cbr1000rr.jpg', | ||
| releaseDate: '2008 to current', | ||
| weight: '439 lbs', | ||
| maxPower: '153.4 hp at 10,700 rpm', | ||
| maxTorque: '78.74 lb.-ft. at 9,400 rpm', | ||
| engineDisplacement: '999 cc' | ||
| }); | ||
| motorcycleLists.push({ | ||
| _id: 134, | ||
| make: 'Triumph', | ||
| model: 'Daytona 675R', | ||
| image: '/images/675r.jpg', | ||
| releaseDate: '2006 to current', | ||
| weight: '363 lbs', | ||
| maxPower: '104 hp at 13,500 rpm', | ||
| maxTorque: '53 lb.-ft. at 10,500 rpm', | ||
| engineDisplacement: '674 cc' | ||
| }) | ||
| motorcycleLists.push({ | ||
| _id: 135, | ||
| make: 'Suzuki', | ||
| model: 'GSX-R 750', | ||
| image: '/images/gsxr750.jpg', | ||
| releaseDate: '2011 to current', | ||
| weight: '418 lbs', | ||
| maxPower: '148 hp at 12,800 rpm', | ||
| maxTorque: '64 lb.-ft. at 11,200 rpm', | ||
| engineDisplacement: '749 cc' | ||
| }); | ||
|
|
||
| // GET /api/albums | ||
| function index(req, res) { | ||
| // send back all albums as JSON | ||
|
|
||
| res.json(motorcycleLists); | ||
|
|
||
| } | ||
|
|
||
| // POST /api/albums | ||
| function create(req, res) { | ||
| // create an album based on request body and send it back as JSON | ||
| } | ||
|
|
||
| // GET /api/albums/:albumId | ||
| function show(req, res) { | ||
| // find one album by id and send it back as JSON | ||
| } | ||
|
|
||
| // DELETE /api/albums/:albumId | ||
| function destroy(req, res) { | ||
| // find one album by id, delete it, and send it back as JSON | ||
| } | ||
|
|
||
| // PUT or PATCH /api/albums/:albumId | ||
| function update(req, res) { | ||
| // find one album by id, update it based on request body, | ||
| // and send it back as JSON | ||
| } | ||
|
|
||
|
|
||
| // export public methods here | ||
| module.exports = { | ||
| index: index, | ||
| create: create, | ||
| show: show, | ||
| destroy: destroy, | ||
| update: update | ||
| }; | ||
Binary file not shown.
This file was deleted.
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 |
|---|---|---|
| @@ -0,0 +1,28 @@ | ||
| // var mongoose = require('mongoose'), | ||
| // const Schema = mongoose.Schema; | ||
|
|
||
| // var CampsiteSchema = new Schema({ | ||
| // description: String | ||
| // }); | ||
|
|
||
| // var Campsite = mongoose.model('Campsite', CampsiteSchema); | ||
|
|
||
| // module.exports = Campsite; | ||
|
|
||
| var mongoose = require('mongoose'), | ||
| Schema = mongoose.Schema; | ||
|
|
||
| const ProfileSchema = new Schema ({ | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It seems like this is data about a motorcycle; why is it in a file called Profile? |
||
| make: String, | ||
| model: String, | ||
| image: String, | ||
| releaseDate: String, | ||
| weight: String, | ||
| maxPower: String, | ||
| maxTorque: String, | ||
| engineDisplacement: String | ||
| }); | ||
|
|
||
| const Profile = mongoose.model('Profile', ProfileSchema); | ||
|
|
||
| module.exports = Profile; | ||
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.
Add something like this to grab all your models/database tables:
var db = require('../models');