From 9aca5480a8c2aa5f294dd4360ad09af16d3f51a7 Mon Sep 17 00:00:00 2001 From: Hykilpikonna Date: Tue, 12 Jan 2021 13:47:00 -0500 Subject: [PATCH] [+] Create api list --- ProjectClock/Net.swift | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) diff --git a/ProjectClock/Net.swift b/ProjectClock/Net.swift index d361b9e..8d01da1 100644 --- a/ProjectClock/Net.swift +++ b/ProjectClock/Net.swift @@ -6,10 +6,25 @@ import Foundation -let baseUrl = "http://localhost:8080/api/" // TODO: Production settings +/// Base URL of the HTTP server +let baseUrl = "http://localhost:8080/api" // TODO: Production settings + +/// API class +struct API +{ + let loc: String +} + +/// Class to store static API endpoints +class APIs +{ + static let register = API(loc: "/user/register") + + private init() {} +} /// Build a URL with the node path and params -func buildUrl(_ node: String, _ params: [String: String]?) -> URL +func url(_ node: String, _ params: [String: String]? = [:]) -> URL { var url = URLComponents(string: baseUrl + node) if let params = params