service: qualee-serverless-flask

plugins:
  - serverless-python-requirements
  - serverless-wsgi
  - serverless-offline
  - serverless-offline-python

custom:
  wsgi:
    app: app.app
    packRequirements: false
  pythonRequirements:
    dockerizePip: non-linux

provider:
  name: aws
  runtime: python3.6
  stage: dev
  region: ap-southeast-1
  profile: qualee

functions:
  app:
    handler: wsgi.handler
    events:
      - http: ANY /
      - http: 'ANY {proxy+}'
  hung:
    handler: app.hung
    events:
        - http:
            path: hung
            method: get
            cors: true
  sendbinary:
    handler: app.sendbinary
    events:
        - http:
            path: sendbinary
            method: post
            cors: true
  comprehend:
    handler: app.comprehend
    events:
        - http:
            path: comprehend
            method: post
            cors: true
  listalldocs:
    handler: app.listalldocs
    events:
        - http:
            path: listalldocs
            method: get
            cors: true
  textractfrompdf_startjob:
    handler: app.textractfrompdf_startjob
    events:
        - http:
            path: textractfrompdf_startjob
            method: post
            cors: true
  textractfrompdf_trackjob:
    handler: app.textractfrompdf_trackjob
    events:
        - http:
            path: textractfrompdf_trackjob
            method: post
            cors: true
  querytexttract:
    handler: app.querytexttract
    events:
        - http:
            path: querytexttract
            method: post
            cors: true
  deletedoc:
    handler: app.deletedoc
    events:
        - http:
            path: deletedoc
            method: post
            cors: true
  updateesdoc:
    handler: app.updateesdoc
    events:
        - http:
            path: updateesdoc
            method: post
            cors: true          
  listallsearchdata:
    handler: app.listallsearchdata
    events:
        - http:
            path: listallsearchdata
            method: post
            cors: true
  search:
    handler: app.search
    events:
        - http:
            path: search
            method: post
            cors: true
  suggest:
    handler: app.suggest
    events:
        - http:
            path: suggest
            method: post
            cors: true
  startdetecttexract:
    handler: app.startdetecttexract
    events:
        - http:
            path: startdetecttexract
            method: post
            cors: true
  runtextract:
    handler: query_textract_cron.runtextract
    events:
        - http:
            path: runtextract
            method: get
            cors: true
  deleterelatedinfo:
    handler: app.deleterelatedinfo
    events:
        - http:
            path: deleterelatedinfo
            method: post
            cors: true
  start_document_ocr:
    handler: app.start_document_ocr
    events:
      - http:
          path: start_document_ocr
          method: post
          cors: true