{"id":15037232,"url":"https://github.com/coldgrub1384/swiftyweb","last_synced_at":"2026-02-15T10:31:57.390Z","repository":{"id":97809970,"uuid":"114682688","full_name":"ColdGrub1384/SwiftyWeb","owner":"ColdGrub1384","description":"Swift CGI helper","archived":false,"fork":false,"pushed_at":"2018-08-08T22:09:27.000Z","size":345,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-13T12:28:52.403Z","etag":null,"topics":["cgi","cgi-script","linux","macos","swift","swift3","swiftlibrary","webserver"],"latest_commit_sha":null,"homepage":"https://coldgrub1384.github.io/SwiftyWeb","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/ColdGrub1384.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":"2017-12-18T20:03:06.000Z","updated_at":"2021-07-31T23:10:34.000Z","dependencies_parsed_at":null,"dependency_job_id":"6f99746d-6a9c-4568-9a3c-285204c0dd9b","html_url":"https://github.com/ColdGrub1384/SwiftyWeb","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/ColdGrub1384/SwiftyWeb","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ColdGrub1384%2FSwiftyWeb","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ColdGrub1384%2FSwiftyWeb/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ColdGrub1384%2FSwiftyWeb/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ColdGrub1384%2FSwiftyWeb/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ColdGrub1384","download_url":"https://codeload.github.com/ColdGrub1384/SwiftyWeb/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ColdGrub1384%2FSwiftyWeb/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":275225965,"owners_count":25427018,"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","status":"online","status_checked_at":"2025-09-15T02:00:09.272Z","response_time":75,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["cgi","cgi-script","linux","macos","swift","swift3","swiftlibrary","webserver"],"created_at":"2024-09-24T20:33:53.972Z","updated_at":"2026-02-15T10:31:57.331Z","avatar_url":"https://github.com/ColdGrub1384.png","language":"Swift","funding_links":[],"categories":[],"sub_categories":[],"readme":"# SwiftyWeb\n\n![Swift](https://img.shields.io/badge/swift-3-orange.svg)\n\u003ca href=\"https://coldgrub1384.github.io/SwiftyWeb/\"\u003e\u003cimg src=\"https://coldgrub1384.github.io/SwiftyWeb/badge.svg\"\u003e\u003c/a\u003e\n\n## Swift library for CGI\n\n- [x] Global variables and functions\n- [x] No need to recompile for each edit (but supported)\n- [x] Automatic library integration, no Package Manager\n- [x] Show compiler errors in browser\n- [ ] MySQL\n\nSwiftyWeb includes a Swift helper for CGI.\n\nYou can use it like this:\n```swift\n// GET\n\"h1\".htm() {\n    print(\"GET Parameters\")\n}\n\n\"ul\".htm() {\n    for (key, value) in GET {\n        \"li\".htm() {\n            print(key+\":\"+value)\n        }\n    }\n}\n\n// POST\n\"h1\".htm() {\n    print(\"POST Parameters\")\n}\n\n\"ul\".htm() {\n    for (key, value) in POST {\n        \"li\".htm() {\n            print(key+\":\"+value)\n        }\n    }\n}\n```\n# Usage\nInit a project, install via the package manager, compile and move?\n\nNO.\n\nWith SwiftyWeb, you can simply write your code and open the browser.\n\n## Linux and Mac\n\nInstall typing this in a shell:\n\n    curl https://raw.githubusercontent.com/ColdGrub1384/SwiftyWeb/master/install 2\u003e/dev/null | sudo bash\n\nOr, inside this repo, run:\n\n\t./install nodownload\n\n### Slow method\nNow, you can write Swift CGIs putting this in the top or your file:\n\n    #!/usr/bin/swiftw\n\n    // Your code here\n    (Don't forget to chmod +x your file)\n\nYou can also include other files:\n\n    #!/usr/bin/swiftw AnotherFile.swift\n\n    // Your code here\n\n### Fast method\nLoading CGIs with '#!/usr/bin/swiftw' is very slow, you can compile files manually typing:\n\nswiftw -o PATH_TO_NEW_EXECUTABLE FILES TO COMPILE\n\nA file will be created and you can put it in your CGI's folder.\n\n## Mac\n\nIn Mac, you can also build the framework opening `SwiftyWeb.xcodeproj` and include framework in your command line project. Don't forget to print `\"Content-Type: text/html\\nContent:\\n\"`!\n\n\n# Documentation\n\nIf you want to contribute to the documentation, don't edit the `docs` directory, but just [document the code](http://nshipster.com/swift-documentation/), the page will be generated by me with [Jazzy](https://github.com/realm/jazzy), or if you want, generate it yourself.\n\n## Generate documentation\n\n- Install Jazzy:\n\n`[sudo] gem install jazzy`\n\n- And run the [`build-documentation.sh`](https://github.com/ColdGrub1384/SwiftyWeb/blob/master/build-documentation.sh) script inside this repo.\n\n- Increment `version` field in [`docs/docsets/Pisth.xml`](https://github.com/ColdGrub1384/SwiftyWeb/blob/master/docs/docsets/SwiftyWeb.xml).\n\n# Example\n\nMy web page is coded with SwiftyWeb: [colg.ddns.net](https://github.com/ColdGrub1384/coldg.ddns.net)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcoldgrub1384%2Fswiftyweb","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcoldgrub1384%2Fswiftyweb","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcoldgrub1384%2Fswiftyweb/lists"}