-
Notifications
You must be signed in to change notification settings - Fork 54
Review #37
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
base: master
Are you sure you want to change the base?
Review #37
Changes from all commits
9ae5ed9
e720a5e
9fec396
78b8770
d54c9d9
96df667
b04aed7
66c7f06
be9a435
4b1b5b1
59910d0
7c4081e
3c17d2d
31b23fd
cf9123c
3ddc400
4349758
5d83663
519a6c5
b4fbff9
82f4389
97cad8e
f31c150
7c7024c
e372e6e
3328280
990c371
41db08b
b6307ca
6c59ce2
4b83939
97cf56c
68ae466
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,16 @@ | ||
| function index(req, res) { | ||
| res.json({ | ||
| message: "Welcome to Skatespot.com!", | ||
| // documentation_url: "https://github.com/sf-wdi-labs/tunely", | ||
| // base_url: "localhost:3000", | ||
| endpoints: [ | ||
| { | ||
| method: "GET", path: "/api", description: "Describes available endpoints" | ||
| } | ||
| ] | ||
| }); | ||
| } | ||
|
|
||
| module.exports = { | ||
| index: index | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,4 @@ | ||
| module.exports = { | ||
| api: require('./apiController'), | ||
| albums: require('./skatespotController'), | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,55 @@ | ||
| /************ | ||
| * DATABASE * | ||
| ************/ | ||
|
|
||
| var db = require('../models'); | ||
|
|
||
| // // GET /api/skatespots | ||
| // function index(req, res) { | ||
| // db.Skatespot.find({}, function(err, allSpots){ | ||
| // res.json(allSpots); | ||
| // }); | ||
| // } | ||
| // | ||
| // // POST /api/skatespots | ||
| // function create(req, res) { | ||
| // console.log('body', req.body); | ||
| // var attributes = req.body.attributes.split(',').map(function(item){ | ||
| // return item.trim();}) | ||
| // req.body.attributes = attributes; | ||
| // db.Skatespot.create(req.body, function(err,skatespot){ | ||
| // if(err) {console.log('error',err);} | ||
| // console.log(skatespot); | ||
| // res.json(skatespot); | ||
| // }) | ||
| // } | ||
| // | ||
| // // GET /api/skatespots/:skatespotId | ||
| // function show(req, res) { | ||
| // db.Skatespot.findById(req.params.skatespotId, function(err, foundSkatespot) { | ||
| // if(err) { console.log('skatespotController.show error', err); } | ||
| // console.log('skatespotController.show responding with', foundSkatespot); | ||
| // res.json(foundSkatespot); | ||
| // }); | ||
| // } | ||
|
|
||
| // DELETE /api/skatespots/:skatespotsId | ||
| function destroy(req, res) { | ||
|
|
||
|
|
||
| } | ||
|
|
||
| // PUT or PATCH /api/skatespots/:skatespotsId | ||
| function update(req, res) { | ||
|
|
||
| } | ||
|
|
||
|
|
||
| // export public methods here | ||
| module.exports = { | ||
| index: index, | ||
| create: create, | ||
| show: show, | ||
| destroy: destroy, | ||
| update: update | ||
| }; | ||
This file was deleted.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,14 @@ | ||
| var mongoose = require('mongoose'), | ||
| Schema = mongoose.Schema; | ||
|
|
||
| var SkatespotSchema = new Schema({ | ||
| spotName: String, | ||
| address: String, | ||
| generalDirections: String, | ||
| attributes: [String], | ||
| // img: | ||
| }); | ||
|
|
||
| var Skatespot = mongoose.model('Skatespot', SkatespotSchema); | ||
|
|
||
| module.exports = Skatespot; |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,10 +1,26 @@ | ||
| body { | ||
| color: #333; | ||
| font-family: Helvetica, Arial, sans-serif; | ||
| background-color: skyblue; /* Sanity Check! */ | ||
| .jumbotron { | ||
| background-image: url(http://www.revolution.co.za/wp-content/uploads/2015/02/Screen-shot-2015-02-13-at-10.41.00-AM.jpg); | ||
| background-size: cover; | ||
| background-repeat: no-repeat; | ||
| color: #EEE; | ||
| } | ||
| .jumbotron .container { | ||
| height: 450px; | ||
| } | ||
|
|
||
| h1 { | ||
| margin-top: 100px; | ||
| .inline-header { | ||
| display: center; | ||
| vertical-align: baseline; | ||
| margin-right: 12px; | ||
| } | ||
| legend { | ||
| text: bold; | ||
| } | ||
| .footer{ | ||
| background-color: black; | ||
| margin-top: 20px; | ||
| padding-top: 20px; | ||
| min-height: 200px; | ||
| text-align: center; | ||
| color: white; | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,15 +1,15 @@ | ||
| // This file allows us to seed our application with data | ||
| // simply run: `node seed.js` from the root of this project folder. | ||
|
|
||
| // var db = require('./models'); | ||
| var db = require('./models'); | ||
|
|
||
| // var new_campsite = {description: "Sharp rocks. Middle of nowhere."} | ||
| var new_skatepark = {description: "Sharp rocks. Middle of nowhere."} | ||
|
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 you didn't actually edit your seed file to be relevant to the structure of your skatespots. |
||
|
|
||
| // db.Campsite.create(new_campsite, function(err, campsite){ | ||
| // if (err){ | ||
| // return console.log("Error:", err); | ||
| // } | ||
| db.Skatepark.create(new_skatepark, function(err, skatepark){ | ||
| if (err){ | ||
| return console.log("Error:", err); | ||
| } | ||
|
|
||
| // console.log("Created new campsite", campsite._id) | ||
| // process.exit(); // we're all done! Exit the program. | ||
| // }) | ||
| console.log("Created new skatepark", skatepark._id) | ||
| process.exit(); // we're all done! Exit the program. | ||
| }) | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -19,7 +19,7 @@ app.use(function(req, res, next) { | |
| * DATABASE * | ||
| ************/ | ||
|
|
||
| // var db = require('./models'); | ||
| var db = require('./models'); | ||
|
|
||
| /********** | ||
| * ROUTES * | ||
|
|
@@ -49,12 +49,12 @@ app.get('/api', function apiIndex(req, res) { | |
| res.json({ | ||
| woopsIForgotToDocumentAllMyEndpoints: true, // CHANGE ME ;) | ||
|
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. Since you have updated all the below lines, you can change this flag to false. Or probably delete the whole line altogether so it does not show up. |
||
| message: "Welcome to my personal api! Here's what you need to know!", | ||
| documentationUrl: "https://github.com/example-username/express-personal-api/README.md", // CHANGE ME | ||
| baseUrl: "http://YOUR-APP-NAME.herokuapp.com", // CHANGE ME | ||
| documentationUrl: "https://github.com/deathofasellout/express-personal-api/README.md", // CHANGE ME | ||
| baseUrl: "https://immense-cove-18493.herokuapp.com/", // CHANGE ME | ||
| endpoints: [ | ||
| {method: "GET", path: "/api", description: "Describes all available endpoints"}, | ||
| {method: "GET", path: "/api/profile", description: "Data about me"}, // CHANGE ME | ||
| {method: "POST", path: "/api/campsites", description: "E.g. Create a new campsite"} // CHANGE ME | ||
| {method: "POST", path: "/api/skateparks", description: "E.g. Create a new skatepark"} // CHANGE ME | ||
| ] | ||
| }) | ||
| }); | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -12,18 +12,76 @@ | |
|
|
||
| <!-- VENDOR SCRIPTS --> | ||
| <script src="//ajax.googleapis.com/ajax/libs/jquery/2.2.2/jquery.min.js"></script> | ||
| <script src="//maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"></script> | ||
|
|
||
| <!-- APPLICATION SCRIPTS --> | ||
| <script src="/scripts/app.js"></script> | ||
| </head> | ||
| <body> | ||
| <div class="container"> | ||
| <div class="row"> | ||
| <div class="col-md-8 col-md-offset-2"> | ||
| <h1>Under Construction</h1> | ||
| <h4><a href="/api">Read My API Documentation</a></h4> | ||
| </div> | ||
| <body> | ||
| <div class="jumbotron"> | ||
| <div class="container"> | ||
| <h1>Skatespot.com</h1> | ||
| <p>Find a Skatespot!</p> | ||
| </div> | ||
| </div> | ||
|
|
||
| <!-- Begin form Section --> | ||
| <section id="skatepark-form" class="container"> | ||
| <!-- a row can be any size in height, grows bootstrap --> | ||
| <div class="row"> <!-- a row just sets up the containters --> | ||
| <!-- offset is spacing, offest by one leaves the 1st container empty | ||
| and starts the div one over from the left, since there are 10 | ||
| it centers it, leaving one column empty on both sides --> | ||
|
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. These comments are awesome! |
||
| <div class="col-lg-10 col-lg-offset-1"> | ||
|
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. I'm concerned that you're using col-lg in some places, and col-md in others--you generally want to use the smallest possible size for everything, so make all of them col-md or col-sm. |
||
| <form class="info-form"> <!--allows you to capture info from a form--> | ||
| <!-- Form Name --> | ||
| <legend>Add A Skatespot</legend> <!--legend gives semantic meaning--> | ||
| <!-- Text input--> | ||
| <div class="form-group"><!--entering col-lg-6 makes it offcenter --> | ||
| <label class="col-md-6 control-label" for="spotName">Enter a | ||
| name:</label> | ||
| <div class="col-md-6"> | ||
| <input id="spotName" name="spotName" type="text" placeholder="" class="form-control input-lg" required=""> | ||
| </div> | ||
| </div> | ||
| <!-- Text input--> | ||
| <div class="form-group"> | ||
| <label class="col-md-6 control-label" for="address">Address:</label> | ||
| <div class="col-md-6"> | ||
| <input id="address" name="address" type="text" placeholder="" class="form-control input-lg"> | ||
| </div> | ||
| </div> | ||
| <!-- Text input--> | ||
| <div class="form-group"> | ||
| <label class="col-md-6 control-label" for="generalDirections">General Directions from the address:</label> | ||
| <div class="col-md-6"> | ||
| <input id="generalDirections" name="generalDirections" type="text" placeholder="" class="form-control input-lg"> | ||
| </div> | ||
| </div> | ||
| <!-- Textarea --> | ||
| <div class="form-group"> | ||
| <label class="col-md-6 control-label" for="attributes">What does this spot have?</label> | ||
| <div class="col-md-6"> | ||
| <textarea class="form-control" id="attributes" name="attributes">Ledges, Rails, Vert</textarea> | ||
| </div> | ||
| </div> | ||
| <!-- Button --> | ||
| <div class="form-group"> | ||
| <label class="col-md-6 control-label" for="singlebutton">Save This Spot!</label> | ||
| <div class="col-md-6"> | ||
| <button id="saveButton" name="saveButton" class="btn btn-primary">Save it, bruh!</button> | ||
| </div> | ||
| </div> | ||
| </fieldset> | ||
| </form> | ||
| </div> | ||
| </div> | ||
| </section> | ||
| <div class="footer"> | ||
| <h3>Connect with other people, share your spots, and have an amazing session.</h3> | ||
| </div> | ||
| </div> | ||
| </body> | ||
| </html> | ||
| <!-- 1.Skate spot name. 2.Address. 3.General Directions from address. 4.What the spot has to offer. 5.Images. --> | ||
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.
It seems like this code is mostly-working, but all commented out--I'm confused by the state this code was left in.