Skip to content

This is the back-end for the Item Viewer demo application

License

Notifications You must be signed in to change notification settings

realitems/item-viewer-backend

Repository files navigation

Item Viewer backend

This is the backend for the Item Viewer demo application. It is a Lambda function that takes requests from the frontend, calls the Real Item API using an API key, and returns the results to the frontend.

You can check out the frontend part here:
https://github.com/realitems/item-viewer-frontend

Usage

This project was built using AWS SAM. If you don't use SAM, or you just want to see the code, you can find it in /lambdas/proxy/index.js.

AWS SAM

If using SAM, set your S3 bucket in samconfig.toml and run the following commands to deploy:

sam build
sam deploy

Debugging

To debug using VSCode, you can use the launch.json file in the .vscode folder. You need to have the AWS Toolkit extension installed for VSCode. In the launch.json file, make sure to set the API_KEY and CONTRACT_ID environment variables.

In launch.json, you can change the payload.path value to test different functions.

Warning: Do not commit your API key.

Notes

If you are deploying to AWS:

  • It is recommended to use Secrets Manager to store your API key.
  • Make sure to implement some type of authentication for the Lambda function URL.

About

This is the back-end for the Item Viewer demo application

Resources

License

Stars

Watchers

Forks