Permalink
Browse files

Use environment variables in our functions

  • Loading branch information...
jayair committed May 6, 2018
1 parent 081ef2e commit 4e6cd44a72ceb195cfebbc035ded75dd3bedd515
Showing with 5 additions and 5 deletions.
  1. +1 −1 create.js
  2. +1 −1 delete.js
  3. +1 −1 get.js
  4. +1 −1 list.js
  5. +1 −1 update.js
@@ -5,7 +5,7 @@ import { success, failure } from "./libs/response-lib";
export async function main(event, context, callback) {
const data = JSON.parse(event.body);
const params = {
TableName: "notes",
TableName: process.env.tableName,
Item: {
userId: event.requestContext.identity.cognitoIdentityId,
noteId: uuid.v1(),
@@ -3,7 +3,7 @@ import { success, failure } from "./libs/response-lib";

export async function main(event, context, callback) {
const params = {
TableName: "notes",
TableName: process.env.tableName,
// 'Key' defines the partition key and sort key of the item to be removed
// - 'userId': Identity Pool identity id of the authenticated user
// - 'noteId': path parameter
2 get.js
@@ -3,7 +3,7 @@ import { success, failure } from "./libs/response-lib";

export async function main(event, context, callback) {
const params = {
TableName: "notes",
TableName: process.env.tableName,
// 'Key' defines the partition key and sort key of the item to be retrieved
// - 'userId': Identity Pool identity id of the authenticated user
// - 'noteId': path parameter
@@ -3,7 +3,7 @@ import { success, failure } from "./libs/response-lib";

export async function main(event, context, callback) {
const params = {
TableName: "notes",
TableName: process.env.tableName,
// 'KeyConditionExpression' defines the condition for the query
// - 'userId = :userId': only return items with matching 'userId'
// partition key
@@ -4,7 +4,7 @@ import { success, failure } from "./libs/response-lib";
export async function main(event, context, callback) {
const data = JSON.parse(event.body);
const params = {
TableName: "notes",
TableName: process.env.tableName,
// 'Key' defines the partition key and sort key of the item to be updated
// - 'userId': Identity Pool identity id of the authenticated user
// - 'noteId': path parameter

0 comments on commit 4e6cd44

Please sign in to comment.