{"id":21194449,"url":"https://github.com/cspray/annotated-container-amp-http-server-demo","last_synced_at":"2025-06-11T21:37:34.817Z","repository":{"id":143070809,"uuid":"524277913","full_name":"cspray/annotated-container-amp-http-server-demo","owner":"cspray","description":"A demo of Annotated Container integrating with Amp's http-server!","archived":false,"fork":false,"pushed_at":"2024-05-04T13:00:20.000Z","size":66,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-06-11T07:18:44.557Z","etag":null,"topics":["php"],"latest_commit_sha":null,"homepage":"","language":"PHP","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/cspray.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":"2022-08-13T02:22:55.000Z","updated_at":"2024-06-07T23:07:15.000Z","dependencies_parsed_at":null,"dependency_job_id":"582aa61c-521d-494b-ac87-24706abf55e0","html_url":"https://github.com/cspray/annotated-container-amp-http-server-demo","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/cspray/annotated-container-amp-http-server-demo","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cspray%2Fannotated-container-amp-http-server-demo","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cspray%2Fannotated-container-amp-http-server-demo/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cspray%2Fannotated-container-amp-http-server-demo/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cspray%2Fannotated-container-amp-http-server-demo/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/cspray","download_url":"https://codeload.github.com/cspray/annotated-container-amp-http-server-demo/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cspray%2Fannotated-container-amp-http-server-demo/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":259346649,"owners_count":22843765,"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":["php"],"created_at":"2024-11-20T19:22:13.275Z","updated_at":"2025-06-11T21:37:34.802Z","avatar_url":"https://github.com/cspray.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Annotated Container Amphp HttpServer Demo\n\nThis library is a \"Hello, World!\" type demo showcasing Annotated Container and Amphp http-server. This library is meant to \nshowcase the following aspects of [Annotated Container](https://github.com/cspray/annotated-container).\n\n- How you can use Annotated Container bootstrapping to easily create your Container.\n- How to configure services, include third-party interfaces, using Annotated Container.\n- How to integrate a service like Amp's server using a type-safe configuration.\n- How to use factories to create services and not rely on the Container to act as a service locator.\n- How you can use custom, semantic attributes to define implementations the Container should be responsible for.\n- How you can automatically wire-up \"complex\" objects, like automatically routing Controllers with no extra configuration or bootstrap changes.\n- An example of the logs that are output by Annotated Container\n\n## Installation\n\nUnlike most packages I maintain this library is _not_ meant to be installed via Composer. You should clone this repo and run it directly.\n\n```shell\ncd /your/workspace\ngit clone https://github.com/cspray/annotated-container-amp-http-server-demo.git\ncd annotated-container-doctrine-demo \u0026\u0026 composer install\n```\n\n## Usage Guide\n\nUsing this app is simple. Run `php app.php`, then visit the following URLs:\n\n- http://localhost:1337/\n- http://localhost:1337/amp\n- https://localhost:1338/\n- https://localhost:1338/amp\n\n## Considerations\n\nThis app is not meant to be a truly production-ready app. It is missing tests, would need to provide more functionality,\nand made some design decisions intentionally to showcase Annotated Container functionality. What's of real import here\nisn't what you can do with the app but the perceived \"cleanliness\" of the code. Please give it a review! Of particular\nimport:\n\n- No YAML or JSON configurations. The configuration that is present is minimal and primarily points to the code that has Attributes on it.\n- Amp's `HttpServer` is created through a Factory that takes in a type-safe Configuration object.\n- Controllers are created and shared with the Container, but we use a custom Attribute, `#[Controller]` to mark it.\n- The Controller Attribute includes routing information and routes are autowired. Add a new `RequestHandler` instance, mark it with `#[Controller]`, then restart your server.\n- The `data/logs/annotated-container.log` file details extensive information about the compilation and Container creation process.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcspray%2Fannotated-container-amp-http-server-demo","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcspray%2Fannotated-container-amp-http-server-demo","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcspray%2Fannotated-container-amp-http-server-demo/lists"}