{"id":25388738,"url":"https://github.com/codefiesta/demo-server","last_synced_at":"2025-07-24T10:11:16.806Z","repository":{"id":75191997,"uuid":"79193184","full_name":"codefiesta/demo-server","owner":"codefiesta","description":"Swift Demo Server using Perfect","archived":false,"fork":false,"pushed_at":"2017-01-18T06:49:31.000Z","size":122,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-02-15T13:46:40.113Z","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":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/codefiesta.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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-01-17T05:46:01.000Z","updated_at":"2017-01-17T06:07:56.000Z","dependencies_parsed_at":"2023-06-05T17:00:36.733Z","dependency_job_id":null,"html_url":"https://github.com/codefiesta/demo-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/codefiesta%2Fdemo-server","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/codefiesta%2Fdemo-server/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/codefiesta%2Fdemo-server/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/codefiesta%2Fdemo-server/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/codefiesta","download_url":"https://codeload.github.com/codefiesta/demo-server/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248113957,"owners_count":21049943,"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":"2025-02-15T13:38:31.494Z","updated_at":"2025-04-09T21:27:38.867Z","avatar_url":"https://github.com/codefiesta.png","language":"Swift","readme":"# DemoServer using PerfectTemplate\n\n# Running Locally\n\nTo run this project with Swift Package Manager, type ```swift build``` and then run ``` .build/debug/DemoServer```.\n\nTo use the example with Xcode, run the **DemoServer** target. This will launch the Perfect HTTP Server. \n\nNavigate in your web browser to [http://localhost:8181/](http://localhost:8181/). Currently the only routes defined are the ***/login*** and ***/secure*** routes.\n\n## URL Routing\n\nThe routes are built from the Router.swift file\n\n```swift\n\nvar routes = Routes()\n\nroutes.add(method: .post, uri: \"/login\", handler: Router.loginHandler)\nroutes.add(method: .get, uri: \"/secure\", handler: Router.secureHandler)\n\n// Test this the server status via command line with curl:\n// curl http://0.0.0.0:8181/status --header \"Content-Type:application/json\"\nroutes.add(method: .get, uri: \"/status\", handler: Router.statusHandler)\n\n// Create server object.\nlet server = HTTPServer()\n\n// Listen on port 8181.\nserver.serverPort = 8181\n\n// Add our routes.\nserver.addRoutes(routes)\n\ndo {\n// Launch the HTTP server\ntry server.start()\n} catch PerfectError.networkError(let err, let msg) {\nprint(\"Network error thrown: \\(err) \\(msg)\")\n}\n```\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcodefiesta%2Fdemo-server","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcodefiesta%2Fdemo-server","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcodefiesta%2Fdemo-server/lists"}