diff --git a/notes.md b/notes.md index a822369..4f555c6 100644 --- a/notes.md +++ b/notes.md @@ -25,10 +25,10 @@ Maybe testing a server before making it public. I cannot think of any other reas program's behavior. Describe a few routes which you think may exist for your chosen program's backend server. - +I chose google docs. It might use a post for login purposes. It might use a get to obtain all of your files on the home page. It might use a post for updating text on documents. 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 something irregular happens in your code that it normally would not know how to deal with it. It might be useful to handle an exception to try to get the user back on the right track. It migh be better to let the program crash if the user is trying to do something that would break your program or harm privacy. diff --git a/riddle_server/app/views.py b/riddle_server/app/views.py index 05270be..16a2fc2 100644 --- a/riddle_server/app/views.py +++ b/riddle_server/app/views.py @@ -2,7 +2,7 @@ from banjo.urls import route_get, route_post from banjo.http import BadRequest, NotFound from app.models import Riddle -@route_get('all', args={}) +@route_get('apple', args={}) def list_riddles(params): riddles = sorted(Riddle.objects.all(), key=lambda riddle: riddle.difficulty()) return {'riddles': [riddle.to_dict(with_answer=False) for riddle in riddles]}