yattee/Model/DataProvider.swift

15 lines
389 B
Swift
Raw Normal View History

2021-06-10 22:50:10 +00:00
import Alamofire
import Foundation
class DataProvider: ObservableObject {
static let instance = "https://invidious.home.arekf.net"
2021-06-11 22:49:42 +00:00
static func request(_ path: String, headers: HTTPHeaders? = nil) -> DataRequest {
AF.request(apiURLString(path), headers: headers)
2021-06-10 22:50:10 +00:00
}
static func apiURLString(_ path: String) -> String {
"\(instance)/api/v1/\(path)"
}
}