summaryrefslogtreecommitdiff
path: root/Homework/cs5260/README.md
diff options
context:
space:
mode:
authorElizabeth Alexander Hunt <me@liz.coffee>2026-07-02 11:55:17 -0700
committerElizabeth Alexander Hunt <me@liz.coffee>2026-07-02 11:55:17 -0700
commit6bf4b90c90f15f4ab60833bddf5b5756d1a6b1f6 (patch)
treeed97e39ec77c5231ffd2c394493e68d00ddac5a4 /Homework/cs5260/README.md
downloadmisc-undergrad-main.tar.gz
misc-undergrad-main.zip
Diffstat (limited to 'Homework/cs5260/README.md')
-rw-r--r--Homework/cs5260/README.md50
1 files changed, 50 insertions, 0 deletions
diff --git a/Homework/cs5260/README.md b/Homework/cs5260/README.md
new file mode 100644
index 0000000..1196082
--- /dev/null
+++ b/Homework/cs5260/README.md
@@ -0,0 +1,50 @@
+# cs5260 consumer
+
+This project uses the [Bun TS Runtime](https://bun.sh/)
+
+To install dependencies:
+
+```bash
+bun install
+```
+
+To run:
+
+```bash
+bun run index.ts
+```
+
+With the arguments:
+```
+--sourcebucket: the bucket to poll for widget requests
+--storagebucket: the bucket to store and modify widgets according to received requests
+--storagetable: the DDB table to store and modify widgets according to received requests
+--storageprefix: the prefix to store S3 objects in (only required if storagebucket is given)
+```
+
+And either one of storagebucket or storagetable must be given.
+
+Unit tests:
+```bash
+bun test
+```
+
+## Lambda Handler
+There is a current bug in bun 1.0.8, the latest version: [https://github.com/oven-sh/bun/issues/7028],
+which is not present in v1.0.7 and earlier. Thus, I recommend using `asdf` to manage the bun version in
+this part of the project.
+
+To deploy the lambda handler, first build and publish the Bun runtime layer on your
+AWS account:
+```bash
+bun run build-layer --arch aarch64 \
+ --release 1.0.7 --output ./bun-lambda-layer.zip
+bun run publish-layer --region us-east-1 \
+ --arch aarch64 --release 1.0.7 \
+ --output ./bun-lambda-layer.zip
+```
+
+Then, create a Lambda function with runtime "custom bootstrap on amazon linux 2" and
+name "widget-api-handler", and handler to "handler.fetch" (found in "Code").
+
+In the Lambda console then attach the layer "bun".