Skip to content

Instantly share code, notes, and snippets.

View schmentle's full-sized avatar
👋

Yentl schmentle

👋
View GitHub Profile
@schmentle
schmentle / index.js
Created December 18, 2021 16:59
Lambda function for sending data to DynamoDB
// Loads in the AWS SDK
const AWS = require('aws-sdk');
// Creates the document client specifing the region. Change this according to your region.
const ddb = new AWS.DynamoDB.DocumentClient({region: 'af-south-1'});
exports.handler = async (event, context, callback) => {
// Captures the requestId from the context message
const requestId = context.awsRequestId;
if(event.name && event.email && event.message) {
@schmentle
schmentle / App.js
Created December 18, 2021 16:54
React to DynamoDB
import React, { useState } from "react";
import "./App.css";
import { useForm } from "react-hook-form";
export default function App() {
const {
register,
handleSubmit,
formState: { errors },
} = useForm();