Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
  • Aug 01 2016 23:48
    @gojko banned @codepreneur
Maurício Vielmo Schmaedeck
@schdck
Should I report this as a bug?
Ghost
@ghost~5e344057d73408ce4fd854ee
@schdck Try using \?
Gojko Adzic
@gojko
@schdck I think that won't work directly, but you can try --set-env-from-json and put everything into a JSON file
Florian
@flotob
hi there. does claudia.js also support voice message processing, i.e. exporting received voice messages in a format like .mp3?
Maurício Vielmo Schmaedeck
@schdck
@mrjackyliang I don't think it will work, take a look at the source that is parsing the CSV: https://github.com/claudiajs/claudia/blob/master/src/util/parse-key-value-csv.js
@gojko Yeah, I was trying to automate deploy using GitHub Actions, but the secrets are all environment variables, so it was easier to just pass them through CLI. Ended up creating a middleware that writes this envs to a JSON and passing this JSON to claudia.
Thanks guys.
W. Matthew Wilson
@mwlevel20
Right now, I have one file called app.js, with a whole bunch of handlers. Is there a standard way to reorganize these into different files?
zohaibemerson
@zohaibemerson
Hi ALl
Is there any reference about how can i connect cloudia to my AWS
imtiazl33t
@imtiazl33t
hi there, i am using claudia to package a Node Express REST API and deploy to my Lambda function. (I am not using claudia-api-builder) All of my endpoints work well except one in which I make external API call to sendgrid. This always returns endpoint request timed out and from the CloudWatch logs I see that it is a Socket Hangup error. I have ascertained that the Lambda's Security Group Outbound Rules allows all TCP traffic. Any ideas what I am doing wrong? Thanks!
Gojko Adzic
@gojko
@mwlevel20 I usually use the standard node.js require mechanism; just split handlers into files (or groups of files) and then link them in from the main file; alternatively, create functions that can receive the API as a parameter, then pass the API around from the main function so others can initialise handlers)
@imtiazl33t check if your function is timing out too quickly (the default is 3 sec); adjusting the timeout with --timeout might help, as could adjusting --memory-size (you get a higher % CPU with more memory, so your function runs faster)
jugglingcats
@jugglingcats
Hi, are there any guidelines or sample code for deploying a lambda for use with the websocket feature of API Gateway? Ideally I would like a single claudiajs deployment that handles the connect, disconnect and message events.
Kiran Kumar
@kiran9866
Hi, I am using lambda and api gateway for my apis. And I deployed my mongodb in EC2. I have been facing the issue "Internal server error". I think, this is because of when api trying to connect with the database. Can anyone help me about this issue?
Slobodan Stojanović
@stojanovic
Can you check CloudWatch logs for more info?
Kiran Kumar
@kiran9866
I checked it.
Slobodan Stojanović
@stojanovic
Nothing in the logs?
Kiran Kumar
@kiran9866
It's giving MongoError: timeout.. kind of error
The problem is when lambda trying to connect with mongodb (ec2).
I think so
Slobodan Stojanović
@stojanovic
Ok, I guess you need to open some ports on EC2 instance for Mongo. Can you connect to that MongoDB from anything else (not Lambda)
Kiran Kumar
@kiran9866
Yes. When I tried to connect to mongodb from GUI, it connected.
Slobodan Stojanović
@stojanovic
Do you use promises/async-await to connect to Mongo from Lambda?
Kiran Kumar
@kiran9866
yes.
SURAJ DATTA
@suraj_datta_twitter

Hi,
I've 2 stages named /latest & /uat. I'm planning to route all project level api's via /latest stage & API Gateway resources(api endpoints) through /uat stage.
I'm using the following code in app.js file as a middleware to detect path name for both the stages:

app.use(function (req, res, next) {
    console.log("CHECK PATH:::", req.path);
    console.log("CHECK REQUEST OBJECT::", req.body);
    next()
})

Project level api paths are getting traced in console logs, but the API gateway endpoints located in /uat are not getting traced here.

Is it possible to trace which API Gateway endpoint is getting called in app.js?

Thanks.

erbsenhirn
@erbsenhirn

Hello,

currently working on the chatbot tutorial (https://claudiajs.com/tutorials/hello-world-chatbot.html) in the skype bot configuration in the last line. What exactly is the webhook url? Is it the url that ends with latest/skype? Also it seems like the link to the skype bot s page is outdated. As there an explaination somewhere, how to create a skype bot with the new process?

Thanks a lot for your help.

Best
Jannis

Slobodan Stojanović
@stojanovic
Unfortunately, Skype bots do not work anymore. They require Azure now.
@suraj_datta_twitter is this express? Logs work for all stages.
SURAJ DATTA
@suraj_datta_twitter
@stojanovic yes i'm using expressJS.
I've used req.apiGateway to trace API gateway details. I'm getting a path key under event object for api's related to /latest stage. But getting empty event object for /uat url's
erbsenhirn
@erbsenhirn
Okay, thanks for the info.
Mathew
@dotmat
Hey guys, is there REST API's exposed for ClaudiaJS Bots? Im trying to use PubNub Functions to a Claudia Bot, I can see all the connectors for FB, Slack, Twilio, but nothing for just a HTTPS POST.. Did I miss something?
Willo vd Merwe
@ion-willo
Hello everyone, is there a way to force Claudia to perform an npm install or similar when deploying? Currently it is bundling a Darwin binary, and cleary that will not work.
I tried installing the offending as an optional dependency and passing --no-optional-dependencies
Willo vd Merwe
@ion-willo
But that causes the package not to be installed on the Lambda causing a Module not found error
Willo vd Merwe
@ion-willo
Okay found --layers
Willo vd Merwe
@ion-willo
Is this still a thing? "...although the documentation suggests that multiple content types can be specified in the Accept header for binary responses, it seems that this breaks the conversion."
How do other Lambda implementations deal with this, then?
SURAJ DATTA
@suraj_datta_twitter
Hi All,
Did anyone faced following issue:
ERROR: aws-serverless-express connection error
It seems to happen after the lambda function times out.
jugglingcats
@jugglingcats
Hi, I'm trying to use claudia in a Github Workflow/Action. Github adds the AWS client id and secret to the environment for the action but I'm not sure how to pass this to claudia?
Ross Coundon
@rcoundon
Hi - Is there a way to use something like archiver to send a zip file as an API Gateway response from a lambda function and does anyone have examples or guidance?
2 replies
Ross Coundon
@rcoundon
async function zipData(content: string): Promise<Buffer> {
  return new Promise((resolve, reject) => {
    const filename = `/tmp/${new Date().valueOf()}.zip`;
    const dataBuffer = Buffer.alloc(content.length, content);
    const output = fs.createWriteStream(filename);
    const archive = Archiver('zip', {
      zlib: { level: 9 },
    });

    output.on('close', () => {
      async function asyncWorker(): Promise<Buffer> {
        return await readFileAsync(filename);
      }
      asyncWorker()
        .then((output) => {
          return resolve(output);
        })
        .catch((err) => {
          return reject(err);
        });
    });

    archive.on('error', (err) => {
      log.error('zipping archive error', err);
      return reject(err);
    });

    archive.pipe(output);
    archive.append(dataBuffer, { name: 'data.csv' });
    archive.finalize();
  });
}
jugglingcats
@jugglingcats
Hi, I'm trying to use claudia in a Github Workflow/Action. Github adds the AWS client id and secret to the environment for the action but I'm not sure how to pass this to claudia? Any advice?
jugglingcats
@jugglingcats
I managed to get my Github workflow working:
#!/usr/bin/env bash

mkdir -p ~/.aws
cat > ~/.aws/credentials << EOF
[deploy]
aws_access_key_id=$AWS_ACCESS_KEY_ID
aws_secret_access_key=$AWS_SECRET_ACCESS_KEY
EOF

export AWS_PROFILE=deploy
./node_modules/.bin/claudia update --no-optional-dependencies --version live
Tadej Vengust
@MoMannn
Hi, has anyone got the problem of
validating package    npm dedupe -q --no-package-lock
npm ERR! code EEXIST
npm ERR! Refusing to delete /tmp/LADlqq/xxx/package/node_modules/claudia/node_modules/.bin/mkdirp: is outside /tmp/LADlqq/xxx/package/node_modules/claudia/node_modules/mkdirp and not a link
I cannot fix this anyway. I use claudia in docker with lambda image. This worked without a problem up till now. But after I updated dependencies this started to happen
Tadej Vengust
@MoMannn
this is the command with which I run it:
claudia update --source dist --handler scripts/lambda.handler --use-local-dependencies --role api-deployment-executor --use-s3-bucket lambda-uploads --memory 1024 --timeout 300 --deploy-proxy-api --region eu-central-1 --config bin/deploy/claudia-dev.json --name app-api-staging
using claudia 5.12.0