File tree 11 files changed +23
-22
lines changed
11 files changed +23
-22
lines changed Original file line number Diff line number Diff line change 1
- const AWSXRay = require ( "aws-xray-sdk-core" ) ;
2
- const { DynamoDBClient, GetItemCommand } = require ( "@aws-sdk/client-dynamodb" ) ;
1
+ import AWSXRay from "aws-xray-sdk-core" ;
2
+ import { DynamoDBClient , GetItemCommand } from "@aws-sdk/client-dynamodb" ;
3
3
4
4
export const handler = async ( event ) => {
5
5
const tableSuffix = process . env . JOKE_TABLE_SUFFIX
Original file line number Diff line number Diff line change 1
- const AWSXRay = require ( "aws-xray-sdk-core" ) ;
2
- const { DynamoDBClient, GetItemCommand } = require ( "@aws-sdk/client-dynamodb" ) ;
1
+ import AWSXRay from "aws-xray-sdk-core" ;
2
+ import { DynamoDBClient , GetItemCommand } from "@aws-sdk/client-dynamodb" ;
3
3
4
4
export const handler = async ( event , context ) => {
5
5
const TIMEOUT_GRACE_PERIOD_IN_MILLIS = 980 ;
Original file line number Diff line number Diff line change 1
- const AWSXRay = require ( "aws-xray-sdk-core" ) ;
2
- const { DynamoDBClient, GetItemCommand } = require ( "@aws-sdk/client-dynamodb" ) ;
1
+ import AWSXRay from "aws-xray-sdk-core" ;
2
+ import { DynamoDBClient , GetItemCommand } from "@aws-sdk/client-dynamodb" ;
3
3
4
4
const tableSuffix = process . env . JOKE_TABLE_SUFFIX
5
5
? process . env . JOKE_TABLE_SUFFIX
Original file line number Diff line number Diff line change 1
- const { SQSClient, SendMessageCommand } = require ( "@aws-sdk/client-sqs" ) ;
1
+ import { SQSClient , SendMessageCommand } from "@aws-sdk/client-sqs" ;
2
2
3
3
const sqsQueueURL = process . env . SQS_QUEUE_URL ;
4
4
Original file line number Diff line number Diff line change 1
- const AWSXRay = require ( "aws-xray-sdk-core" ) ;
2
- const { DynamoDBClient, GetItemCommand } = require ( "@aws-sdk/client-dynamodb" ) ;
1
+ import AWSXRay from "aws-xray-sdk-core" ;
2
+ import { DynamoDBClient , GetItemCommand } from "@aws-sdk/client-dynamodb" ;
3
3
4
4
const tableSuffix = process . env . JOKE_TABLE_SUFFIX
5
5
? process . env . JOKE_TABLE_SUFFIX
Original file line number Diff line number Diff line change 1
- const express = require ( "express" ) ;
2
- const bodyParser = require ( "body-parser" ) ;
1
+ import express from "express" ;
2
+ import bodyParser from "body-parser" ;
3
+
3
4
const app = express ( ) ;
4
5
const port = 3000 ;
5
6
Original file line number Diff line number Diff line change 1
- const serverless = require ( "serverless-http" ) ;
2
- const app = require ( "./api.js" ) . app ;
1
+ import serverless from "serverless-http" ;
2
+ import { app } from "./api.js" ;
3
3
4
4
export const handler = serverless ( app , {
5
5
request ( request , event , context ) {
Original file line number Diff line number Diff line change 1
- const { DynamoDBClient, GetItemCommand } = require ( "@aws-sdk/client-dynamodb" ) ;
1
+ import { DynamoDBClient , GetItemCommand } from "@aws-sdk/client-dynamodb" ;
2
2
3
3
const ddb = new DynamoDBClient ( ) ;
4
4
Original file line number Diff line number Diff line change 1
- const { mockClient } = require ( "aws-sdk-client-mock" ) ;
2
- const { DynamoDBClient, GetItemCommand } = require ( "@aws-sdk/client-dynamodb" ) ;
3
- const handler = require ( "./index.js" ) . handler ;
1
+ import { mockClient } from "aws-sdk-client-mock" ;
2
+ import { DynamoDBClient , GetItemCommand } from "@aws-sdk/client-dynamodb" ;
3
+ import { handler } from "./index.js" ;
4
4
5
5
const ddbMock = mockClient ( DynamoDBClient ) ;
6
6
Original file line number Diff line number Diff line change 1
- const AWSXRay = require ( "aws-xray-sdk-core" ) ;
2
- const {
1
+ import AWSXRay from "aws-xray-sdk-core" ;
2
+ import {
3
3
DynamoDBClient ,
4
4
GetItemCommand ,
5
5
PutItemCommand ,
6
- } = require ( "@aws-sdk/client-dynamodb" ) ;
6
+ } from "@aws-sdk/client-dynamodb" ;
7
7
8
8
const tableSuffix = process . env . JOKE_TABLE_SUFFIX
9
9
? process . env . JOKE_TABLE_SUFFIX
Original file line number Diff line number Diff line change 1
- const AWSXRay = require ( "aws-xray-sdk-core" ) ;
2
- const { DynamoDBClient, GetItemCommand } = require ( "@aws-sdk/client-dynamodb" ) ;
1
+ import AWSXRay from "aws-xray-sdk-core" ;
2
+ import { DynamoDBClient , GetItemCommand } from "@aws-sdk/client-dynamodb" ;
3
3
4
4
const tableSuffix = process . env . JOKE_TABLE_SUFFIX
5
5
? process . env . JOKE_TABLE_SUFFIX
You can’t perform that action at this time.
0 commit comments