---
  description: Provides a demonstration structure for a http server configured in the protocol mapper

  metadata:
    name: Definition By Example for HTTP Endpoints

  parameters: {}

  resources:
    httpServer:
      type: Cybus::Server::Http
      properties:
        basePath: /cybustest

    postRoute:
      type: Cybus::Node::Http
      properties:
        parent: !ref httpServer
        method: POST
        route: /postRoute

    putRoute:
      type: Cybus::Node::Http
      properties:
        parent: !ref httpServer
        method: PUT
        route: /putRoute

    getRoute:
      type: Cybus::Node::Http
      properties:
        parent: !ref httpServer
        method: GET
        route: /getRoute

    httpMapping:
      type: Cybus::Mapping
      properties:
        mappings:
          - subscribe:
              endpoint: !ref postRoute
            publish:
              topic: output/postroute
          - subscribe:
              endpoint: !ref putRoute
            publish:
              topic: output/putroute
          - subscribe:
              topic: input/getRoute
            publish:
              endpoint: !ref getRoute
