Skip to content

Instantly share code, notes, and snippets.

@owenso
Last active August 29, 2015 14:24
Show Gist options
  • Save owenso/eb037261ae7f72df9c3d to your computer and use it in GitHub Desktop.
Save owenso/eb037261ae7f72df9c3d to your computer and use it in GitHub Desktop.
Week 5 assessment
1.The advantages of using a database include Atomocity (modifications will either all take place or the whole thing will be canceled, which helps prevent corrupted data and conflicts from half executed code), Consistancy (which helps programs and other programmers access your data), Isolation (data is queued and is modified in order, which helps Atomocity), and Durability (that data will exist until deleted).
2.
3. A database schema is something which tells the database what sort of data to expect, and what type of data it will be.
4. The browser is sending a put request, with a path of "/orders/:id". The code is taking in an id number from the path and storing an "order" object (from inputs in the browser) in an array within the data.json with an index of that id number.
5. Create, Read, Update, Destroy. Our apps will be able to modify data in all four of those ways. For example, in SQL, Create = INSERT, Read = SELECT, Update = UPDATE, and Destroy = DELETE.
6. Get - The browser sends a request to try to get data from the server.
Put - The browser sends a request to try to update data on the server.
Post - The browser sends a request to try to post new data to the server.
Delete - The browser sends a request to try to delete data from the server.
7."npm.init" helps us create a package.json file. It asks for inputs for the fields in a package.json, provides defaults if fields are left blank and tells programs which read the created json file where the server is. If additional modules are installed, it keeps track of them and allows users to quickly install packages needed for a project.
8. A Node Package Module is a module which adds additional functionality to Node.js. We have used handlebars-express, which allows us to dynamically create pages using a template, morgan, which logs server actions to the console, and nodemon, which automatically restarts the node server when it detects changes to the server file.
9. We can use forms to submit data to a server by including the form in our webpage, then getting the values from the request object. Some attributes of a form are "name", which is used to find the value of the fields and method, which specifies the http method of the request.
10. Forms can only be submitted via post or get. To perform a put or delete request, an aditional hidden input with the desired method is needed in the form.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment