The challenge is to build a Bookmarking API that allows one to save, retreive, share, and preview links.
- AWS DynamoDB database for Bookmark data.
- AWS API Gateway implements Bookmark REST API
- AWS Lambda runs business logic invoked by API Gateway and DynamoDB Streams.
- MindTouch LambdaSharp Tool build and deploy clouldformation stack and assets to AWS.
{
"ID": "32a7cf5a-35be-459a-b586-ec2bed2f4fef",
"Url": "https://www.youtube.com/watch?v=M5NVwuyk2uM",
"Title": "The Dream Smartphone! (2019)",
"Description": "The impossible dream of the perfect smartphone in ...",
"ImageUrl": "https://i.ytimg.com/vi/M5NVwuyk2uM/maxresdefault.jpg"
}For this challenge, we will be using a pre-release version of the LambdaSharp Tool that is easier to configure and use.
If you already have the LambdaSharp Tool installed, unfortunately you cannot simply upgrade it to a pre-release version. First, you have to uninstall the previous version, then install the new version.
```
dotnet tool uninstall -g LambdaSharp.Tool
dotnet tool install -g LambdaSharp.Tool --version 0.7-RC3
```
```
dotnet tool install -g LambdaSharp.Tool --version 0.7-RC3
```
git clone git@github.com:LambdaSharp/Bookmarker.git
cd Bookmarker
lash init --quick-start // one time
lash deploy // to propagate code changes
Currently, bookmarks are created with a 37-character id (a guid) like 10cffe9e-ace5-444c-836b-635e6ec207d3. Modify the POST AddBookmark API endpoint to instead use a short ID that is still unique. This will allow a future version of our Bookmark service to generate short urls like https://bookmark.er/xYq.
Ideally, you would NOT use a simple sequential integer as that would allow our competitors to know how many bookmarks are in our system.
When a new bookmark is added to DynamoDB, it will only store the ID and Url. However, we want to record more information about our Bookmark in order to support a preview feature (Level 3). On an insert into our DynamoDB table, the lambda function DynamoFunction will be triggered.
Modify that function to retrieve the OpenGraph data from the URL and update the Bookmark in DynamoDB to include the following fields: Title, Description, and ImageUrl.
OpenGraph-Net -- library used in this challenge
Modify the API Gateway lambda function for the endpoint GET:/preview/{id} to return an HTML preview of a Bookmark. The HTML should include OpenGraph tags so that the preview renders correctly when shared in apps such as Slack, iMessage, etc.
Modfy Module.yml file to add a new API endpoint called GET:/redirect/{id} which invokes a method that performs an HTTP redirect to the original Bookmark url.
Extend the Bookmark data model to include a list of categories that are relevant to the Bookmark. Your job is to figure out how to get the list of categories.
