generated from mwc/lab_server
Commit for both checkpoints 1 and 2
This commit is contained in:
parent
d32c206602
commit
e021bd1bab
13
notes.md
13
notes.md
|
@ -7,12 +7,16 @@
|
|||
server? What are some advantages of using a program or an app which is
|
||||
completely local?
|
||||
|
||||
An advantage of using a program that uses a remote server is not having to use your own storage to host the program, and you can access it from anywhere more easily since it's designed for that. Advantages of a completely local program would be security and control. You can more directly control who/what has access to it, and can keep the program and files related to it more secure.
|
||||
|
||||
|
||||
|
||||
2. You just ran a server on your own computer, and connected to it as a client
|
||||
on the same computer. In what other situations might it be useful to run a
|
||||
server on your computer, where you're the only client, on the same computer?
|
||||
|
||||
If you are running a home security system or a smart home. Currently, smart home and iot devices require you to sign up for an account and share data. A more secure version of this would host everything on your own server and network, and restrict access to only those with a connection to the network.
|
||||
|
||||
|
||||
|
||||
## Checkpoint 2
|
||||
|
@ -23,10 +27,17 @@
|
|||
program's behavior. Describe a few routes which you think may exist for your
|
||||
chosen program's backend server.
|
||||
|
||||
Google docs
|
||||
|
||||
1. A route which allows me to see
|
||||
the files that are stored under my account. This might be similar, though likely more complicated to the route which shows all riddles.
|
||||
|
||||
2. A post route which allows me to create a new google doc. It would probably contain code to connect it to my account.
|
||||
|
||||
3. A route which allows me to see docs that have been shared with me. It would have to check if I have been given the permission to view the document. If I have, it would send a get request for that document. If I have not, it would probably return a 405 error.
|
||||
|
||||
4. In your own words, what is an exception? When might it be useful to handle an
|
||||
exception? When is it better not to handle an exception, and instead let the
|
||||
program crash?
|
||||
|
||||
|
||||
An exception is when the user asks the program to do something that it cannot do. The exception could be anything from asking for something that doesn't exist, asking for something incorrectly (bad request) or asking for something that it doesn't have access to. It's better to handle the exception when you want to communicate to the user what type of error they have made and/or provide them an opportunity to make another request. It may be better to let the program crash if it doesn't impact other users who have permissions to access the server and/or if the specific request that the user made indicates some form of unauthorized access to secure materials.
|
||||
|
|
Loading…
Reference in New Issue