fix(curriculum): Convert blockquote elements to triple backtick syntax for Apis And Microservices (#35996)

* fix: converted blockquotes

* fix: revert to blockquote

* fix: changed js to http

Co-Authored-By: Oliver Eyton-Williams <ojeytonwilliams@gmail.com>

* fix: reverted back to blockquote

* fix: reverted back to blockquote

* fix: reverted back to blockquote
This commit is contained in:
Randell Dawson
2019-05-14 05:00:06 -07:00
committed by Tom
parent 46411ca1cd
commit 4dbd496b49
16 changed files with 106 additions and 45 deletions

View File

@ -14,14 +14,17 @@ A model allows you to create instances of your objects, called documents.
Glitch is a real server, and in real servers the interactions with the db happen in handler functions. These function are executed when some event happens (e.g. someone hits an endpoint on your API). Well follow the same approach in these exercises. The <code>done()</code> function is a callback that tells us that we can proceed after completing an asynchronous operation such as inserting, searching, updating or deleting. Its following the Node convention and should be called as <code>done(null, data)</code> on success, or <code>done(err)</code> on error.
Warning - When interacting with remote services, errors may occur!
<blockquote>
/* Example */<br><br>
var someFunc = function(done) {<br>
&nbsp;&nbsp;//... do something (risky) ...<br>
&nbsp;&nbsp;if(error) return done(error);<br>
&nbsp;&nbsp;done(null, result);<br>
```js
/* Example */
var someFunc = function(done) {
//... do something (risky) ...
if(error) return done(error);
done(null, result);
};
</blockquote>
```
</section>
## Instructions

View File

@ -12,13 +12,16 @@ In this challenge you will have to create and save a record of a model.
## Instructions
<section id='instructions'>
Create a document instance using the <code>Person</code> constructor you built before. Pass to the constructor an object having the fields <code>name</code>, <code>age</code>, and <code>favoriteFoods</code>. Their types must conform to the ones in the Person Schema. Then call the method <code>document.save()</code> on the returned document instance. Pass to it a callback using the Node convention. This is a common pattern, all the following CRUD methods take a callback function like this as the last argument.
<blockquote>
/* Example */<br><br>
// ...<br>
person.save(function(err, data) {<br>
&nbsp;&nbsp;// ...do your stuff here...<br>
```js
/* Example */
// ...
person.save(function(err, data) {
// ...do your stuff here...
});
</blockquote>
```
</section>
## Tests