Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Activity
  • Aug 05 14:28
    willfarrell commented #883
  • Aug 05 13:09
    vicary commented #883
  • Aug 05 13:08
    vicary synchronize #883
  • Aug 04 21:37

    willfarrell on main

    chore: dep updates (compare)

  • Aug 04 21:18

    willfarrell on 3.1.1

    (compare)

  • Aug 04 21:18

    willfarrell on main

    feat: add in module param to npm chore: version bump (compare)

  • Aug 03 04:52
    vicary commented #883
  • Aug 03 04:51
    vicary commented #883
  • Aug 03 04:48
    vicary commented #883
  • Aug 03 04:48
    vicary synchronize #883
  • Aug 02 14:25
    vicary commented #883
  • Aug 02 14:21
    vicary synchronize #883
  • Aug 02 13:29
    vicary commented #883
  • Aug 02 13:24
    vicary synchronize #883
  • Aug 02 05:22
    willfarrell commented #883
  • Aug 02 05:21
    vicary commented #883
  • Aug 01 15:09
    vicary commented #883
  • Aug 01 15:09
    vicary commented #883
  • Aug 01 15:07
    vicary synchronize #883
  • Aug 01 15:00
    vicary commented #883
Luciano Mammino
@lmammino
Hello Everybody :)
Nikita Glushchenko
@NPCRUS
Hi man
Luciano Mammino
@lmammino
Hey @NPCRUS, how are you?
dkatavic
@dkatavic
Hello :)
Nikita Glushchenko
@NPCRUS
@lmammino I'm fine, and you?
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