{"id":13535196,"url":"https://github.com/Macro-swift/MacroApp","last_synced_at":"2025-04-02T00:32:49.949Z","repository":{"id":63916833,"uuid":"276413914","full_name":"Macro-swift/MacroApp","owner":"Macro-swift","description":"A SwiftUI-like, declarative way to setup MacroExpress Endpoints","archived":false,"fork":false,"pushed_at":"2024-09-19T11:20:26.000Z","size":65,"stargazers_count":32,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"develop","last_synced_at":"2024-10-11T13:33:40.789Z","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":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Macro-swift.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2020-07-01T15:26:12.000Z","updated_at":"2024-09-19T11:20:30.000Z","dependencies_parsed_at":"2023-01-14T13:45:23.541Z","dependency_job_id":null,"html_url":"https://github.com/Macro-swift/MacroApp","commit_stats":null,"previous_names":[],"tags_count":8,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Macro-swift%2FMacroApp","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Macro-swift%2FMacroApp/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Macro-swift%2FMacroApp/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Macro-swift%2FMacroApp/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Macro-swift","download_url":"https://codeload.github.com/Macro-swift/MacroApp/tar.gz/refs/heads/develop","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":222788514,"owners_count":17037777,"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-08-01T08:00:51.136Z","updated_at":"2024-11-02T23:30:56.484Z","avatar_url":"https://github.com/Macro-swift.png","language":"Swift","readme":"\u003ch2\u003eMacroApp\n  \u003cimg src=\"http://zeezide.com/img/macro/MacroExpressIcon128.png\"\n       align=\"right\" width=\"100\" height=\"100\" /\u003e\n\u003c/h2\u003e\n\nMacroApp layers on top of \n[MacroExpress](https://github.com/Macro-swift/MacroExpress/)\nto provide a SwiftUI like, declarative setup of endpoints.\n\nIt is a little more opinionated than MacroExpress.\n\n\u003e [MacroExpress](https://github.com/Macro-swift/MacroExpress/)\n\u003e is a small, unopinionated \"don't get into my way\" / \"I don't wanna `wait`\" \n\u003e asynchronous web framework for Swift.\n\u003e With a strong focus on replicating the Node APIs in Swift.\n\u003e But in a typesafe, and fast way.\n\nMacroApp is just syntactic sugar (using Swift function builders) on top of\nMacroExpress. The configuration is evaluated into a regular MacroExpress\nbased app (with routes and middleware).\n\n## Example\n\nMacroApp:\n\n```swift\n@main\nstruct HelloWorld: App {\n  \n  var body: some Endpoints {\n    Use(logger(\"dev\"), bodyParser.urlencoded())\n          \n    Route(\"/admin\") {\n      Get(\"/view\") { req, res, _ in res.render(\"admin-index.html\") }\n      Render(\"help\", template: \"help\")\n    }\n      \n    Get { req, res, next in\n      res.render(\"index.html\")\n    }\n  }\n}\n```\n\nInstead of this traditional route setup (as in [MacroExpress](https://github.com/Macro-swift/MacroExpress/)):\n\n```swift\nlet app = express()\n\napp.use(logger(\"dev\"), bodyParser.urlencoded())\n\napp.route(\"/admin\")\n   .get(\"/view\") { req, res, _ in res.render(\"admin-index.html\") }\n\napp.get(\"/\") { req, res, _ in res.render(\"index.html\") }\n\napp.listen(1337) {\n    console.log(\"Server listening on http://localhost:1337\")\n}\n```\n\n\n## Environment Variables\n\n- `macro.core.numthreads`\n- `macro.core.iothreads`\n- `macro.core.retain.debug`\n- `macro.concat.maxsize`\n- `macro.streams.debug.rc`\n- `macro.router.debug`\n- `macro.router.matcher.debug`\n\n### Links\n\n- [MacroExpress](https://github.com/Macro-swift/MacroExpress/)\n- [Macro](https://github.com/Macro-swift/Macro/)\n- [µExpress](http://www.alwaysrightinstitute.com/microexpress-nio2/)\n- [Noze.io](http://noze.io)\n- [SwiftNIO](https://github.com/apple/swift-nio)\n- JavaScript Originals\n  - [Connect](https://github.com/senchalabs/connect)\n  - [Express.js](http://expressjs.com/en/starter/hello-world.html)\n- Swift Apache\n  - [mod_swift](http://mod-swift.org)\n  - [ApacheExpress](http://apacheexpress.io)\n\n### Who\n\n**MacroExpress** is brought to you by\n[Helge Heß](https://github.com/helje5/) / [ZeeZide](https://zeezide.de).\nWe like feedback, GitHub stars, cool contract work, \npresumably any form of praise you can think of.\n\nThere is a `#microexpress` channel on the \n[Noze.io Slack](http://slack.noze.io/). Feel free to join!\n","funding_links":[],"categories":["Server-Side"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FMacro-swift%2FMacroApp","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FMacro-swift%2FMacroApp","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FMacro-swift%2FMacroApp/lists"}