by gitgud · 6y ago · 0 comments
Some other things I would do:
- Simplify API: (/service/${STATE})
- Create a dictionary of ${STATE} to RequestHandler's for all cases, and a default case.
- Divide as much functionality into reusable stateless functions.
- Compose RequestHandler's with reusable functions.
Now when the server receives a request with ${STATE} it can look up the appropriate handler in the dictionary and process the request.