Now that the services are implemented, let's move to the orchestration layer with the RESTful endpoints.
Replace the contents of app.py in the Chalice project with the following code:
from chalice import Chalice
from chalicelib import storage_service
from chalicelib import recognition_service
from chalicelib import translation_service
#####
# chalice app configuration
#####
app = Chalice(app_name='Capabilities')
app.debug = True
#####
# services initialization
#####
storage_location = 'contents.aws.ai'
storage_service = storage_service.StorageService(storage_location)
recognition_service = recognition_service.RecognitionService(storage_service)
translation_service = translation_service.TranslationService()
#####
# RESTful endpoints
#####
...
In the preceding code, the following applies:
- The first four lines of code handle the imports for chalice...