3.0 KiB
Project Server Notes
Checkpoint 1
-
Lots of software today connects to remote servers, and can't work offline. What are some advantages of using a program or an app which uses a remote 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.
-
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
-
Choose a program (Steam), web app (Google Docs), or app (Weather) that you use frequently. You can't observe the calls this program is making to its server (unless you have fancy tools), but you can infer some of the calls based on the program's behavior. Describe a few routes which you think may exist for your chosen program's backend server.
Google docs
-
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.
-
A post route which allows me to create a new google doc. It would probably contain code to connect it to my account.
-
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.
-
-
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.