Helpers.swift 468 B

1234567891011121314151617181920
  1. //
  2. // Helpers.swift
  3. // ntfy
  4. //
  5. // Created by Philipp Heckel on 5/16/22.
  6. //
  7. import Foundation
  8. let appBaseUrl = "http://192.168.1.4" // FIXME
  9. func topicUrl(baseUrl: String, topic: String) -> String {
  10. return "\(baseUrl)/\(topic)"
  11. }
  12. func topicShortUrl(baseUrl: String, topic: String) -> String {
  13. return topicUrl(baseUrl: baseUrl, topic: topic)
  14. .replacingOccurrences(of: "http://", with: "")
  15. .replacingOccurrences(of: "https://", with: "")
  16. }