Allow configuration of the service URLs by ENV variables
All checks were successful
Build and Publish Docker Container / build (push) Successful in 5m37s

This commit is contained in:
Joshua Coles 2023-10-07 14:56:13 +01:00
parent 735e16ed2c
commit babbbf2be5
3 changed files with 5 additions and 3 deletions

View File

@ -1,7 +1,7 @@
module Panopto
# @param [String] folder_id
def self.list_folder(folder_id)
HTTParty.get("https://lectures.joshuacoles.me/api/list", query: {
HTTParty.get("#{PANOPTO_PORTAL_URL}/api/list", query: {
folderId: folder_id
})
end

View File

@ -1,7 +1,7 @@
module Toggl
def self.entries_for_project(toggl_project_id, start_time:, end_time:)
JSON.parse(HTTParty.post(
"http://localhost:3005/report",
"#{TOGGL_PORTAL_URL}/report",
body: {
"start_date": start_time.to_date.to_fs(),
"end_date": end_time.to_date.to_fs(),
@ -13,7 +13,7 @@ module Toggl
def self.start_time_entry(description:, project_id:)
HTTParty.post(
"http://localhost:3005/start_time_entry",
"#{TOGGL_PORTAL_URL}/start_time_entry",
body: {
"created_with": "Attendance Tracker",
"description": description,

View File

@ -0,0 +1,2 @@
TOGGL_PORTAL_URL = ENV['TOGGL_PORTAL_URL'] || 'http://localhost:3005'
PANOPTO_PORTAL_URL = ENV['PANOPTO_PORTAL_URL'] || 'https://lectures.joshuacoles.me'