mirror of
https://github.com/opelly27/CloudResumeBackend.git
synced 2026-05-19 23:18:29 +00:00
Add files via upload
This commit is contained in:
@@ -0,0 +1,29 @@
|
||||
import json
|
||||
import boto3
|
||||
|
||||
def lambda_handler(event, context):
|
||||
|
||||
client = boto3.resource('dynamodb')
|
||||
table = client.Table('visitor_count')
|
||||
|
||||
response = table.update_item(
|
||||
Key = {
|
||||
'path': "index.html"
|
||||
|
||||
},
|
||||
AttributeUpdates={
|
||||
'visitor_count':{
|
||||
|
||||
'Value': 1,
|
||||
'Action': 'ADD'
|
||||
}
|
||||
})
|
||||
|
||||
response = table.get_item(Key = {'path':'index.html'})
|
||||
|
||||
visitor_count = response['Item']['visitor_count']
|
||||
return {
|
||||
'statusCode': 200,
|
||||
'headers': {'Access-Control-Allow-Origin': '*'},
|
||||
'body': visitor_count
|
||||
}
|
||||
Reference in New Issue
Block a user