Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Activity
  • Jun 24 12:38
    willfarrell commented #868
  • Jun 24 12:38

    willfarrell on main

    Use aws-sdk submodule Update index.d.ts Add all references and 1 more (compare)

  • Jun 24 12:38
    willfarrell closed #868
  • Jun 23 09:51
    shaikatz edited #868
  • Jun 23 09:48
    shaikatz synchronize #868
  • Jun 23 09:42
    shaikatz synchronize #868
  • Jun 23 09:41
    shaikatz edited #868
  • Jun 23 09:40
    shaikatz edited #868
  • Jun 23 09:40
    shaikatz edited #868
  • Jun 23 09:39
    shaikatz edited #868
  • Jun 23 09:39
    shaikatz opened #868
  • Jun 22 05:50
    vinceniko commented #867
  • Jun 22 05:47
    vinceniko closed #867
  • Jun 22 05:45
    vinceniko opened #867
  • Jun 22 03:18

    willfarrell on main

    ci: add tests for formats ci: add more format tests (compare)

  • Jun 22 00:08
    willfarrell edited #769
  • Jun 21 20:40
    willfarrell edited #769
  • Jun 21 16:39
    willfarrell commented #850
  • Jun 21 16:38
    willfarrell commented #850
  • Jun 21 16:33
    tylerzisk commented #850
Luciano Mammino
@lmammino
@NPCRUS Great, finalising a PR for a new middleware for content negotiation :)
Nikita Glushchenko
@NPCRUS
nice
Luciano Mammino
@lmammino
@NPCRUS now ready for review if you want to have a look: middyjs/middy#104
Joe Minichino
@techfort
Hello bastards and bitches
Luciano Mammino
@lmammino
we love you too @techfort :D
Joe Minichino
@techfort
On a serious note, I will probably start a repo for the Go version of muddy since I'm using go a lot now and aws have recently added go support to lambdas @lmammino
Luciano Mammino
@lmammino
That would be cool @techfort , do you want to open the repo under the middyjs organisation? you should have permission to do so
Doruk Kutlu
@d0ruk
hi there
i have trouble with bodyparser
const handler = middy(awesomeLogic)
  .use(jsonBodyParser())
  .use(cors());

export default handler;

async function awesomeLogic(evt, ctx) {
  // typeof evt.body === "string"
  // it's a POST evt with content-type: application/json
}
according to the src, middleware parses the body back into evt.body
thus i expect that to be typeof evt.body === "object"
what am i doing wrong?
Luciano Mammino
@lmammino
Hello @d0ruk, are you checking if your Content-Type headers are sent in canonical format (right casing)?
if you are not sure wheter they come in canonical format or not, you can use the httpHeaderNormalizer middleware before the jsonBodyParser.
Let me know if this fixes your problem
Doruk Kutlu
@d0ruk
that fixed it
thx
Luciano Mammino
@lmammino
You are welcome @d0ruk, glad it worked for you ;)
Doruk Kutlu
@d0ruk
is there a reference repo for middy integration? i.e. examples
Luciano Mammino
@lmammino
@d0ruk, Do you mean writing your own middlewares?
Doruk Kutlu
@d0ruk
no, i read the docs.md
i meant a repo where i can scan some code
Luciano Mammino
@lmammino
regarding middy internals or use cases?
Doruk Kutlu
@d0ruk
to gauge best practices
use cases
Luciano Mammino
@lmammino
@DavidWells created an example repo, it might be useful: https://github.com/DavidWells/middy-example
Doruk Kutlu
@d0ruk
cheers
Luciano Mammino
@lmammino
You are welcome, @d0ruk, let us know if there's anything that is not clear or that we can improve in your opinion :)
Doruk Kutlu
@d0ruk
will do
Jose Santacruz
@joseSantacruz
Hi all, quick serverless question is there a way to preview the generated cloud formation files without building all the artifacts??
Chanlito
@chanlito
I found middyjs today, and I have to say, thank you, to @lmammino & all the contributors.
Luciano Mammino
@lmammino
@chanlito, thanks to your for trying middy :)
@joseSantacruz did you figure it out a way? I know that serverless framework has a command to build a package but not publish it, that way you should be able to see the cloudformation files
Thomas Edwards
@thomasedwards
I just found Middy today :heart_eyes:
Just casually re-writing my entire project now
dkatavic
@dkatavic
hello @thomasedwards . I hope you are gonna find it useful :smile:
Luciano Mammino
@lmammino
@thomasedwards looking forward to receiving your feedbacks :P
Today we just passed 200 stars!!! :)
Thomas Edwards
@thomasedwards
amazing!
has anybody ever had a Cannot destructure propertyhttpContentNegotiationof 'undefined' or 'null' error?
import middy from 'middy'

const {
  httpContentNegotiation,
  httpErrorHandler
} = middy.middlewares

const lovelyStuff = event => {
  // do stuff
}

const handler = middy(lovelyStuff)
  .use(httpContentNegotiation({ availableMediaTypes: ['application/json'] }))
  .use(jsonBodyParser())
  .use(httpErrorHandler())

export { handler }
I think it's because I'm using imports
Thomas Edwards
@thomasedwards
yup changed it to
const {
  httpContentNegotiation,
  httpErrorHandler,
  jsonBodyParser,
  validator
} = require('middy/middlewares')
Thomas Edwards
@thomasedwards
so when I import anything from middy/middlewares, I get the entire AWS library because of the S3 middleware?
this bumps up my file size from less than 1MB to 3.5MB
Thomas Edwards
@thomasedwards
done some digging and opened an issue: middyjs/middy#154
Luciano Mammino
@lmammino
Hello @thomasedwards , thanks a million for your contribution and sorry for the long wait, i was away for a conference :)
looking into your issue right now
Thomas Edwards
@thomasedwards
thank you! =)