- short_url_service.py -> containing encode/decode APIs
- short_url_utils.py -> contains utilities for generating shortURL string
- memore_store.py -> wrapper for in memory store
- note that this was implemented using a regular python hash dictionary
- would have replaced it with Redis.
- this src file contains wrapper for in-memory-store so it makes it easier to replace with different DB implementations
- test/api_test.py -> API tests
- 1x encode (POST) API test
- 1x decode (GET) API test
- 1x mixed test
- with more time I would have created a stress test
response: {"original_url":"www.daher.com"}
- You can also run the test in test/ directory (it runs the service so no need for manual service running before)
- cd tests
- pytest -rP api_test.py