now-python-lambda

1.0.20 • Public • Published

now-python-lambda

A now builder for creating python lambda functions.

Example usage

now.json

{
  "version": 2,
  "name": "now-python-lambda-example",
  "builds": [
    {
      "src": "backend/config.json",
      "use": "now-python-lambda"
    }
  ]
}

backend/config.json

{
  "functions": {
    "hello_world": {
      "entrypoint": "api/hello_world",
      "handler": "hello_world.handler"
    }
  }
}

backend/hello_world.py

import json

def handler(event, context):
    return {
        'statusCode': 200,
        'headers': {
            'content-type': 'application/json'
        },
        'body': json.dumps({
          'data': 'hello world'
        })
    }

/now-python-lambda/

    Package Sidebar

    Install

    npm i now-python-lambda

    Weekly Downloads

    0

    Version

    1.0.20

    License

    MIT

    Unpacked Size

    5.95 kB

    Total Files

    4

    Last publish

    Collaborators

    • mperreux