logan lab 11-12#11
Open
loganlsr wants to merge 9 commits intocodefellows-seattle-javascript-401d10:masterfrom
Open
logan lab 11-12#11loganlsr wants to merge 9 commits intocodefellows-seattle-javascript-401d10:masterfrom
loganlsr wants to merge 9 commits intocodefellows-seattle-javascript-401d10:masterfrom
Conversation
Raziyehbazargan
pushed a commit
to Raziyehbazargan/lab-11-12-express-api
that referenced
this pull request
Sep 27, 2016
…fellows/lec-11 added lecture-11
bnates
reviewed
Oct 3, 2016
| @@ -0,0 +1 @@ | |||
| {"id":"245efb70-84f4-11e6-9ac7-f5fcfad695e3","type":"example","color":"colorexample","size":"examplesize"} No newline at end of file | |||
There was a problem hiding this comment.
@loganlsr no need to push up your JSON data files - add these to your gitignore to avoid overpopulating the repo
| @@ -0,0 +1,19 @@ | |||
| 'use strict'; | |||
| @@ -0,0 +1,7 @@ | |||
| 'use strict'; | |||
There was a problem hiding this comment.
@loganlsr nice inclusion of the cors module for allowing all requests
| err = createError(500, err.message); | ||
| res.status(err.status).send(err.name); | ||
| next(); | ||
| }; |
| const debug = require('debug')('note:storage'); | ||
| const fs = Promise.promisifyAll(require('fs'), {suffix: 'Prom'}); | ||
|
|
||
| const mkdirp = Promise.promisifyAll(require('mkdirp')); |
There was a problem hiding this comment.
@loganlsr good use of promises in conjuction with the mkdirp module
| return fs.readdirProm(`${__dirname}/../data/${schemaName}`) | ||
| .then( filenames => filenames.map(name => name.split('.json')[0])) | ||
| .catch(err => Promise.reject(createError(404, err.message))); | ||
| }; |
| type: 'example', | ||
| color: 'colorexample', | ||
| size: 'examplesize' | ||
| }; |
| }); | ||
|
|
||
| describe('testing POST requests to /api/apple', function(){ | ||
| describe('with a valid body', function(){ |
There was a problem hiding this comment.
@loganlsr no need for a space here - that said, your after block looks good
| }); | ||
| }); | ||
| }); | ||
| }); |
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
No description provided.