Skip to content

esl/amoc_rest

Folders and files

NameName
Last commit message
Last commit date

Latest commit

d9f6422 · Nov 27, 2024

History

48 Commits
Nov 16, 2024
Nov 16, 2024
Nov 27, 2024
Jun 5, 2020
Nov 11, 2024
Jun 2, 2020
Nov 27, 2024
Nov 27, 2024
Nov 13, 2024
Nov 16, 2024
Nov 16, 2024

Repository files navigation

amoc_rest

The generated server code for AMOC REST API

initial generation

  • initial version of the project is generated using openapi-generator.

    make generate

compilation and execution of the project

  • compilation of the project can be done using this command:

    make compile
  • to test the project you can run:

    make console

    and then, execute in the erlang shell:

      ModuleHandler = openapi_callbacks, %% Module implementing the callbacks behaviour
      TransportOpts = #{socket_opts => [{ip, {0, 0, 0, 0}}, {port, Port}]},
      ProtocolOpts = #{metrics_callback => fun prometheus_cowboy2_instrumenter:observe/1,
                       stream_handlers => [cowboy_metrics_h]},
      amoc_rest_server:start(
          openapi_http_server,
          #{
              transport => tcp,
              transport_opts => TransportOpts,
              protocol_opts => ProtocolOpts,
              logic_handler => ModuleHandler
          }
      ).

swagger-ui integration

  • the dist version of the swagger-ui is integrated under /api-docs/ path (e.g. http://localhost:4000/api-docs/)
  • the online version of the documentation is also available here (w/o possibility of execution)