Skip to content

Commit

Permalink
latest
Browse files Browse the repository at this point in the history
  • Loading branch information
crzypatchwork committed Apr 27, 2021
1 parent c4041e2 commit e23b448
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 16 deletions.
10 changes: 5 additions & 5 deletions .serverless/cloudformation-template-update-stack.json
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@
"S3Bucket": {
"Ref": "ServerlessDeploymentBucket"
},
"S3Key": "serverless/mongo-hicetnunc/dev/1619566576195-2021-04-27T23:36:16.195Z/mongo-hicetnunc.zip"
"S3Key": "serverless/mongo-hicetnunc/dev/1619567312330-2021-04-27T23:48:32.330Z/mongo-hicetnunc.zip"
},
"Handler": "handler.database",
"Runtime": "nodejs12.x",
Expand All @@ -179,14 +179,14 @@
"HandlerLogGroup"
]
},
"HandlerLambdaVersionwtltpTlkH64bI9sAl0nwgA37oiWCG7mmjkTyjx0t0": {
"HandlerLambdaVersionltZOFi9XiCWDtyDW5lk23sqG8jBIsPQUNA8HzQNGw0": {
"Type": "AWS::Lambda::Version",
"DeletionPolicy": "Retain",
"Properties": {
"FunctionName": {
"Ref": "HandlerLambdaFunction"
},
"CodeSha256": "DJVskb/x5lf+E8ujhoEj8hoWJ20tSiNX8/viMiJu7DU="
"CodeSha256": "pEAdiPFWULlwLlfP5b1en0X1dpRIBcmthoSXGSD34Z8="
}
},
"ApiGatewayRestApi": {
Expand Down Expand Up @@ -398,7 +398,7 @@
"MethodResponses": []
}
},
"ApiGatewayDeployment1619566570486": {
"ApiGatewayDeployment1619567306642": {
"Type": "AWS::ApiGateway::Deployment",
"Properties": {
"RestApiId": {
Expand Down Expand Up @@ -463,7 +463,7 @@
"HandlerLambdaFunctionQualifiedArn": {
"Description": "Current Lambda function version",
"Value": {
"Ref": "HandlerLambdaVersionwtltpTlkH64bI9sAl0nwgA37oiWCG7mmjkTyjx0t0"
"Ref": "HandlerLambdaVersionltZOFi9XiCWDtyDW5lk23sqG8jBIsPQUNA8HzQNGw0"
},
"Export": {
"Name": "sls-mongo-hicetnunc-dev-HandlerLambdaFunctionQualifiedArn"
Expand Down
Binary file modified .serverless/mongo-hicetnunc.zip
Binary file not shown.
16 changes: 8 additions & 8 deletions .serverless/serverless-state.json
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,7 @@
"S3Bucket": {
"Ref": "ServerlessDeploymentBucket"
},
"S3Key": "serverless/mongo-hicetnunc/dev/1619566576195-2021-04-27T23:36:16.195Z/mongo-hicetnunc.zip"
"S3Key": "serverless/mongo-hicetnunc/dev/1619567312330-2021-04-27T23:48:32.330Z/mongo-hicetnunc.zip"
},
"Handler": "handler.database",
"Runtime": "nodejs12.x",
Expand All @@ -192,14 +192,14 @@
"HandlerLogGroup"
]
},
"HandlerLambdaVersionwtltpTlkH64bI9sAl0nwgA37oiWCG7mmjkTyjx0t0": {
"HandlerLambdaVersionltZOFi9XiCWDtyDW5lk23sqG8jBIsPQUNA8HzQNGw0": {
"Type": "AWS::Lambda::Version",
"DeletionPolicy": "Retain",
"Properties": {
"FunctionName": {
"Ref": "HandlerLambdaFunction"
},
"CodeSha256": "DJVskb/x5lf+E8ujhoEj8hoWJ20tSiNX8/viMiJu7DU="
"CodeSha256": "pEAdiPFWULlwLlfP5b1en0X1dpRIBcmthoSXGSD34Z8="
}
},
"ApiGatewayRestApi": {
Expand Down Expand Up @@ -411,7 +411,7 @@
"MethodResponses": []
}
},
"ApiGatewayDeployment1619566570486": {
"ApiGatewayDeployment1619567306642": {
"Type": "AWS::ApiGateway::Deployment",
"Properties": {
"RestApiId": {
Expand Down Expand Up @@ -476,7 +476,7 @@
"HandlerLambdaFunctionQualifiedArn": {
"Description": "Current Lambda function version",
"Value": {
"Ref": "HandlerLambdaVersionwtltpTlkH64bI9sAl0nwgA37oiWCG7mmjkTyjx0t0"
"Ref": "HandlerLambdaVersionltZOFi9XiCWDtyDW5lk23sqG8jBIsPQUNA8HzQNGw0"
},
"Export": {
"Name": "sls-mongo-hicetnunc-dev-HandlerLambdaFunctionQualifiedArn"
Expand Down Expand Up @@ -655,7 +655,7 @@
"timeout": 6,
"runtime": "nodejs12.x",
"vpc": {},
"versionLogicalId": "HandlerLambdaVersionwtltpTlkH64bI9sAl0nwgA37oiWCG7mmjkTyjx0t0"
"versionLogicalId": "HandlerLambdaVersionltZOFi9XiCWDtyDW5lk23sqG8jBIsPQUNA8HzQNGw0"
}
},
"configValidationMode": "warn",
Expand Down Expand Up @@ -1385,7 +1385,7 @@
"node_modules/negotiator/README.md"
],
"artifact": "/home/crzy/Desktop/lambdas/mongo2/mongodb-hicetnunc/.serverless/mongo-hicetnunc.zip",
"artifactDirectoryName": "serverless/mongo-hicetnunc/dev/1619566576195-2021-04-27T23:36:16.195Z"
"artifactDirectoryName": "serverless/mongo-hicetnunc/dev/1619567312330-2021-04-27T23:48:32.330Z"
},
"plugins": {
"$ref": "$[\"service\"][\"plugins\"]"
Expand All @@ -1401,7 +1401,7 @@
"artifact": "/home/crzy/Desktop/lambdas/mongo2/mongodb-hicetnunc/.serverless/mongo-hicetnunc.zip"
},
"package": {
"artifactDirectoryName": "serverless/mongo-hicetnunc/dev/1619566576195-2021-04-27T23:36:16.195Z",
"artifactDirectoryName": "serverless/mongo-hicetnunc/dev/1619567312330-2021-04-27T23:48:32.330Z",
"artifact": "mongo-hicetnunc.zip"
}
}
6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,8 @@
# mongodb-hicetnunc

`
https://vj4pzbqrsa.execute-api.us-east-1.amazonaws.com/dev/objkt?token_id=30000
https://vj4pzbqrsa.execute-api.us-east-1.amazonaws.com/dev/tag?tag=GAN
https://vj4pzbqrsa.execute-api.us-east-1.amazonaws.com/dev/objkts { arr : [ 30000 ] }
`

3 changes: 0 additions & 3 deletions handler.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ const getTag = async (req, res) => {
const database = client.db('OBJKTs-DB')
const objkts = database.collection('metadata')
let r = await objkts.find({ tags : { $all : [ req.query.tag ]}})
console.log(r.toArray)
res.json({
result : await r.toArray()
})
Expand All @@ -32,14 +31,12 @@ const getTag = async (req, res) => {
// get objkt by id

const getObjkt = async (req, res) => {
console.log(req.query)
const client = new MongoClient(url)

await client.connect()
const database = client.db('OBJKTs-DB')
const objkts = database.collection('metadata')
let r = await objkts.find({ token_id : parseInt(req.query.token_id) })
console.log(r.toArray)

res.json({
result : await r.toArray()
Expand Down

0 comments on commit e23b448

Please sign in to comment.