diff --git a/.serverless/cloudformation-template-update-stack.json b/.serverless/cloudformation-template-update-stack.json index cbd9390..c125a58 100644 --- a/.serverless/cloudformation-template-update-stack.json +++ b/.serverless/cloudformation-template-update-stack.json @@ -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", @@ -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": { @@ -398,7 +398,7 @@ "MethodResponses": [] } }, - "ApiGatewayDeployment1619566570486": { + "ApiGatewayDeployment1619567306642": { "Type": "AWS::ApiGateway::Deployment", "Properties": { "RestApiId": { @@ -463,7 +463,7 @@ "HandlerLambdaFunctionQualifiedArn": { "Description": "Current Lambda function version", "Value": { - "Ref": "HandlerLambdaVersionwtltpTlkH64bI9sAl0nwgA37oiWCG7mmjkTyjx0t0" + "Ref": "HandlerLambdaVersionltZOFi9XiCWDtyDW5lk23sqG8jBIsPQUNA8HzQNGw0" }, "Export": { "Name": "sls-mongo-hicetnunc-dev-HandlerLambdaFunctionQualifiedArn" diff --git a/.serverless/mongo-hicetnunc.zip b/.serverless/mongo-hicetnunc.zip index ea34ec9..43cd6a6 100644 Binary files a/.serverless/mongo-hicetnunc.zip and b/.serverless/mongo-hicetnunc.zip differ diff --git a/.serverless/serverless-state.json b/.serverless/serverless-state.json index 92ee6f6..6198b85 100644 --- a/.serverless/serverless-state.json +++ b/.serverless/serverless-state.json @@ -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", @@ -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": { @@ -411,7 +411,7 @@ "MethodResponses": [] } }, - "ApiGatewayDeployment1619566570486": { + "ApiGatewayDeployment1619567306642": { "Type": "AWS::ApiGateway::Deployment", "Properties": { "RestApiId": { @@ -476,7 +476,7 @@ "HandlerLambdaFunctionQualifiedArn": { "Description": "Current Lambda function version", "Value": { - "Ref": "HandlerLambdaVersionwtltpTlkH64bI9sAl0nwgA37oiWCG7mmjkTyjx0t0" + "Ref": "HandlerLambdaVersionltZOFi9XiCWDtyDW5lk23sqG8jBIsPQUNA8HzQNGw0" }, "Export": { "Name": "sls-mongo-hicetnunc-dev-HandlerLambdaFunctionQualifiedArn" @@ -655,7 +655,7 @@ "timeout": 6, "runtime": "nodejs12.x", "vpc": {}, - "versionLogicalId": "HandlerLambdaVersionwtltpTlkH64bI9sAl0nwgA37oiWCG7mmjkTyjx0t0" + "versionLogicalId": "HandlerLambdaVersionltZOFi9XiCWDtyDW5lk23sqG8jBIsPQUNA8HzQNGw0" } }, "configValidationMode": "warn", @@ -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\"]" @@ -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" } } \ No newline at end of file diff --git a/README.md b/README.md index 31879d9..3ef0a66 100644 --- a/README.md +++ b/README.md @@ -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 ] } +` + diff --git a/handler.js b/handler.js index 035a735..eefb26d 100644 --- a/handler.js +++ b/handler.js @@ -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() }) @@ -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()