0.0.2-alpha.0 • Published 4 years ago

ft-parser v0.0.2-alpha.0

Weekly downloads
-
License
ISC
Repository
-
Last release
4 years ago

ft-parser serverless

Tech

Functions

HTTP Trigger Function (API Gateway)

functions:

  # API Endpoints
  http:
    handler: handler.http  #Path to function
    memorySize: 128 # Lambda Memory Limit
    timeout: 60 # Lambda Timeout
    events:
      - http: # HTTP Trigger
          cors: true
          path: '/message'  # API Endpoint
          method: post  # HTTP Method

MQTT Trigger Function (IOT Events)

functions:

  # Mqtt Trigger
  mqtt:
    handler: handler.mqtt #Path to function
    events:
      - iot: # IOT Trigger
          sql: "SELECT * FROM 'mybutton'" #Topic

Development environment

FT-Parser uses serverless-local plugin and some containers and plugins to emulate the AWS Resources

docker-compose up

The applications will start on http://localhost:3000

Dev Plugins

FT-Parser contains following plugins for local development:

Deploy a function

serverless deploy function -f ft-parser

Get function logs

serverless ft-parser

Testing

Parse Message

curl -X POST \
    -H "Content-Type: application/json" \
    -d '{
    "deviceName": "61bef2dd-58bf-479d-a58a-00ef87b1cc90",
    "data": "AP6lAWcAUQJoNQP\/AMM=",
    "timestamp": 1548404613
}' \
    http://localhost:3000/message -i