{"id":13489521,"url":"https://github.com/cezarywojcik/Swift-Server","last_synced_at":"2025-03-28T05:31:00.163Z","repository":{"id":34266934,"uuid":"38152877","full_name":"cezarywojcik/Swift-Server","owner":"cezarywojcik","description":"A very basic proof-of-concept Swift HTTP server that does not require Foundation","archived":false,"fork":false,"pushed_at":"2015-12-04T10:53:53.000Z","size":15,"stargazers_count":56,"open_issues_count":0,"forks_count":6,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-03-27T10:37:24.472Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","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/cezarywojcik.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}},"created_at":"2015-06-27T08:20:55.000Z","updated_at":"2023-04-09T06:22:17.000Z","dependencies_parsed_at":"2022-09-13T04:51:05.626Z","dependency_job_id":null,"html_url":"https://github.com/cezarywojcik/Swift-Server","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cezarywojcik%2FSwift-Server","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cezarywojcik%2FSwift-Server/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cezarywojcik%2FSwift-Server/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cezarywojcik%2FSwift-Server/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/cezarywojcik","download_url":"https://codeload.github.com/cezarywojcik/Swift-Server/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245978200,"owners_count":20703675,"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-07-31T19:00:29.963Z","updated_at":"2025-03-28T05:30:59.777Z","avatar_url":"https://github.com/cezarywojcik.png","language":"Swift","funding_links":[],"categories":["Libs"],"sub_categories":["Network"],"readme":"# Swift Server\n\n## Introduction\n\nThis is very rough and basic HTTP server written in Swift without using `Foundation`.\n\nThis is partially based on the [Swifter](https://github.com/glock45/swifter) repo, however, the point is to eliminate the need for Apple's `Foundation` library to prepare for using Swift on Linux.\n\nThis is built using [Swift Script Include](https://github.com/cezarywojcik/Swift-Script-Include) to enable using multiple files for Swift scripts and runs without Xcode purely on the terminal.\n\n## Installation Notes\n\nThis is built using Swift 2, and requires your command-line `swift` to be using Swift 2 as well. You can check your Swift version by running `swift --version` in your terminal. If you are running Swift 1.2 instead of 2.0, first, make sure that you have the Xcode 7 beta installed. Next, run the following command:\n\n```\nsudo xcode-select -switch /Applications/Xcode-beta.app/Contents/Developer\n```\n\n## Running\n\nTo run the project, simply type `make run` in the project directory.\n\nVisit [`http://127.0.0.1:3000`](http://127.0.0.1:3000) in your web browser to see a friendly \"Hello, World!\" message. The HTTP request will be printed in your terminal.\n\n## Example Code\n\nThe functionality is currently very basic. The code below shows what the server can currently do.\n\n```\ninclude \"lib/server.swift\"\n\nlet app = Server(port: port)\n\napp.run() {\n    request, response -\u003e () in\n    print(request.raw)\n    response.sendRaw(\"HTTP/1.1 200 OK\\n\\nHello, World!\\n\")\n}\n\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcezarywojcik%2FSwift-Server","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcezarywojcik%2FSwift-Server","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcezarywojcik%2FSwift-Server/lists"}