GithubHelp home page GithubHelp logo

adieuadieu / alagarr Goto Github PK

View Code? Open in Web Editor NEW
59.0 3.0 8.0 1.32 MB

🦍 Alagarr is a request-response helper library that removes the boilerplate from your Node.js (AWS Lambda) serverless functions and helps make your code portable.

License: MIT License

TypeScript 100.00%
serverless aws-apigateway aws-lambda aws-lambda-node request response no-if-statement faas functionalesque-programming no-dependencies

alagarr's People

Contributors

adieuadieu avatar iamn1ck avatar mosch avatar renovate-bot avatar renovate[bot] avatar svlapin avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

alagarr's Issues

Trying to apply a response middleware

Trying to assign a simple response middleware to evaluate GitHub tokens with X-Hub-Signature. Getting an error such as There was an error in the error handler provided to Alagaar TypeError: middleware is not a function at Object.<anonymous> (/var/task/node_modules/alagarr/dist/src/utils/apply-middleware.js:13:117)

Applying it with a config like {responseMiddleware: ['default', validateSignature]}

Using node 8.10 on AWS Lambda

Is the latest version in published to npm or is there bug with callback?

Is the latest version published to the npm?

I am just wondering because of this handler:

export const myFunction = alagarr(async (request, response) => {
  try {
    const data = await data();
    return response.json(data);
  } catch (error) {
    throw new ClientError(error);
  }
});

gives me a warning:

Serverless: Warning: handler 'myFunction' returned a promise and also uses a callback!
This is problematic and might cause issues in your lambda.

Is this bug in the library or is the npm version older?

npm install alagarr --save install version ^1.0.0-26 and, if I try to install directly from GitHub the dist folder is empty, so I cant test directly from the master.

However, thanks for the great library.

Dependency Dashboard

This issue lists Renovate updates and detected dependencies. Read the Dependency Dashboard docs to learn more.

Rate-Limited

These updates are currently rate-limited. Click on a checkbox below to force their creation now.

  • ⬆️ Update dependency @types/node to v18
  • ⬆️ Update dependency husky to v8
  • ⬆️ Update dependency lint-staged to v13
  • ⬆️ Update dependency rimraf to v4
  • ⬆️ Update dependency typescript to v5
  • 🔐 Create all rate-limited PRs at once 🔐

Open

These updates have all been created already. Click a checkbox below to force a retry/rebase of any.

Ignored or Blocked

These are blocked by an existing closed PR and will not be recreated unless you click a checkbox below.

Detected dependencies

npm
package.json
  • @commitlint/cli 7.6.1
  • @commitlint/config-conventional 7.6.0
  • @types/aws-lambda 8.10.14
  • @types/jest 23.3.13
  • @types/node 9.6.56
  • coveralls 3.1.1
  • husky 0.14.3
  • jest 23.6.0
  • lint-staged 8.2.1
  • nsp 3.2.1
  • nyc 12.0.2
  • prettier 1.19.1
  • rimraf 2.7.1
  • semantic-release 15.14.0
  • ts-jest 23.10.5
  • tslint 5.14.0
  • tslint-functional-preset 1.5.0
  • typescript 3.7.2
  • node >= 6.10

  • Check this box to trigger a request for Renovate to run again on this repository

Dependency deprecation warning: nsp (npm)

On registry https://registry.npmjs.org/, the "latest" version (v3.2.1) of dependency nsp has the following deprecation notice:

The Node Security Platform service is shutting down 9/30 - https://blog.npmjs.org/post/175511531085/the-node-security-platform-service-is-shutting

Marking the latest version of an npm package as deprecated results in the entire package being considered deprecated, so contact the package author you think this is a mistake.

Affected package file(s): package.json

If you don't care about this, you can close this issue and not be warned about nsp's deprecation again. If you would like to completely disable all future deprecation warnings then add the following to your config:

"suppressNotifications": ["deprecationWarningIssues"]

Safe headers request middleware

Add a request middleware which verifies safety of headers. E.g.

☐ Verify that header values in both requests and responses contain only ASCII characters

Return directly from handler

return an object from handler, automatically returned to response.json() or response.respondTo() if return { json: {}, html: '' }

Overload response method signatures

Overload response method function signatures to support: (body, statusCode, options), (statusCode, body, options), (body, options, statusCode)

Add jsdoc comments to methods

E.g. in src/types.ts

export interface InterfaceResponse {
  /**
   * Redirect to a new location.
   */
  readonly redirect: (
    location: string,
    statusCode?: number,
    options?: InterfaceResponseOptions,
  ) => void

  ...

}

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.