{"id":15873646,"url":"https://github.com/tombuildsstuff/infrastructure-toolkit-swift-vapor","last_synced_at":"2025-04-01T22:42:24.319Z","repository":{"id":142076164,"uuid":"64727572","full_name":"tombuildsstuff/infrastructure-toolkit-swift-vapor","owner":"tombuildsstuff","description":"An Implementation of the Infrastructure Toolkit for the Vapor Web Framework","archived":false,"fork":false,"pushed_at":"2016-11-12T15:03:40.000Z","size":5,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-02-07T14:46:11.552Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Swift","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/tombuildsstuff.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2016-08-02T05:42:16.000Z","updated_at":"2016-11-12T15:03:36.000Z","dependencies_parsed_at":"2023-07-09T05:32:12.282Z","dependency_job_id":null,"html_url":"https://github.com/tombuildsstuff/infrastructure-toolkit-swift-vapor","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tombuildsstuff%2Finfrastructure-toolkit-swift-vapor","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tombuildsstuff%2Finfrastructure-toolkit-swift-vapor/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tombuildsstuff%2Finfrastructure-toolkit-swift-vapor/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tombuildsstuff%2Finfrastructure-toolkit-swift-vapor/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/tombuildsstuff","download_url":"https://codeload.github.com/tombuildsstuff/infrastructure-toolkit-swift-vapor/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246724794,"owners_count":20823543,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-10-06T01:04:58.253Z","updated_at":"2025-04-01T22:42:24.312Z","avatar_url":"https://github.com/tombuildsstuff.png","language":"Swift","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Infrastructure Toolkit (Swift) for Vapor\n\nThis is an implementation of the [Infrastructure Toolkit](https://github.com/tombuildsstuff/infrastructure-toolkit-swift) for the Vapor web framework.\n\nThere's a [proper description](https://github.com/tombuildsstuff/infrastructure-toolkit-swift#fundamentals) on the [Infrastructure Toolkit repo](https://github.com/tombuildsstuff/infrastructure-toolkit-swift) - go check it out.\n\n## Usage\n\n### Step 1: Create a Monitor\n\n```\nimport Foundation\nimport InfrastructureToolkit\n\n@objc\npublic class ExampleServiceStatusMonitor : NSObject, ServiceStatusMonitor {\n\n    public var name : String {\n        get { return \"Example\" }\n    }\n\n    public func checkIsHealthy() throws -\u003e ServiceStatusResult {\n        let summary = \"oh hai\"\n        var properties = [String: String]()\n        properties[\"foo\"] = \"bar\"\n        properties[\"hello\"] = \"there\"\n\n        let metaData = ServiceStatusResultMetaData(summary, properties)\n        return ServiceStatusResult(name: self.name, successful: true, metaData: metaData)\n    }\n    \n}\n\n```\n\n### Step 2: Hook up the Routing\n\n```\nimport HTTP\nimport InfrastructureToolkitVapor\nimport Vapor\n\nlet drop = Droplet(providers: [])\n\nlet monitors = [ SomeExampleMonitor() ]\n\ndrop.registerInfrastructureToolkit(monitors: monitors)\n\ndrop.get(\"/hello-world\") {\n  (request: Request) throws -\u003e ResponseRepresentable in\n    return \"Hello World\"\n}\n\nlet port = 5000\ndrop.serve()\n\n```\n\n### Step 3: Build \u0026 Run\n```\nvapor build\nvapor run\n```\n\n### Step 4: Try it out:\n - /service-status\n - /service-status/{monitorName}\n\n## Licence\nMIT\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftombuildsstuff%2Finfrastructure-toolkit-swift-vapor","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftombuildsstuff%2Finfrastructure-toolkit-swift-vapor","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftombuildsstuff%2Finfrastructure-toolkit-swift-vapor/lists"}