From b9ab7b696370037a1dd513896334b0965f86a4c5 Mon Sep 17 00:00:00 2001 From: Noah Durbin <13364668+noahdurbin@users.noreply.github.com> Date: Fri, 30 Aug 2024 14:10:06 -0600 Subject: [PATCH] feat: service to connect to microservice summary ping endpoint --- app/services/summary_service.rb | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 app/services/summary_service.rb diff --git a/app/services/summary_service.rb b/app/services/summary_service.rb new file mode 100644 index 0000000..bff4f9d --- /dev/null +++ b/app/services/summary_service.rb @@ -0,0 +1,14 @@ +class SummaryService + def conn + Faraday.new( + url: 'https://nameless-garden-14218-de5663d17d61.herokuapp.com/', + headers: { 'Content-Type' => 'application/json' } + ) + end + + def summarize + conn.post('api/v1/ping') do |req| + req.body = { link: 'wwww.example.com' }.to_json + end + end +end