{"id":21531948,"url":"https://github.com/matrixai/http-demo","last_synced_at":"2025-03-17T19:27:58.497Z","repository":{"id":151338467,"uuid":"283804932","full_name":"MatrixAI/HTTP-Demo","owner":"MatrixAI","description":"Demo of an basic HTTP server wrapped up as Nix project","archived":false,"fork":false,"pushed_at":"2022-02-15T02:25:01.000Z","size":13,"stargazers_count":1,"open_issues_count":0,"forks_count":1,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-01-24T06:29:45.771Z","etag":null,"topics":["http","http-server","https","https-server","socat"],"latest_commit_sha":null,"homepage":"https://matrix.ai","language":"Nix","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/MatrixAI.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":"2020-07-30T15:00:22.000Z","updated_at":"2022-04-22T15:22:22.000Z","dependencies_parsed_at":null,"dependency_job_id":"bab0112a-d1f3-4349-8f0d-6e5151c6b698","html_url":"https://github.com/MatrixAI/HTTP-Demo","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/MatrixAI%2FHTTP-Demo","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MatrixAI%2FHTTP-Demo/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MatrixAI%2FHTTP-Demo/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MatrixAI%2FHTTP-Demo/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/MatrixAI","download_url":"https://codeload.github.com/MatrixAI/HTTP-Demo/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244095995,"owners_count":20397320,"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":["http","http-server","https","https-server","socat"],"created_at":"2024-11-24T02:18:17.506Z","updated_at":"2025-03-17T19:27:58.486Z","avatar_url":"https://github.com/MatrixAI.png","language":"Nix","funding_links":[],"categories":[],"sub_categories":[],"readme":"# HTTP-Demo\n\n## Installation\n\n### Nix/NixOS\n\nBuilding the package:\n\n```sh\nnix-build -E '(import ./pkgs.nix).callPackage ./default.nix {}'\n```\n\nBuilding the releases:\n\n```sh\nnix-build ./release.nix --attr application\nnix-build ./release.nix --attr docker\n```\n\nInstall into Nix user profile:\n\n```sh\nnix-env -f ./release.nix --install --attr application\n```\n\n### Docker\n\nInstall into Docker:\n\n```sh\ndocker load --input \"$(nix-build ./release.nix --attr docker)\"\n```\n\n## Usage\n\n```sh\nhttp-demo 55555\ncurl http://localhost:55555/\n```\n\nOr after you have tagged your container image with `latest`:\n\n```sh\ndocker run -it --rm --network=host http-demo:latest 55555\n```\n\nOr with port mapping:\n\n```sh\ndocker run -it --rm -p 55555:55555 http-demo:INSERTYOURTAG 55555\n```\n\n## Deployment\n\n### Deploying to AWS ECS:\n\nFirst login to AWS ECR:\n\n```sh\naws --profile=matrix ecr get-login-password --region ap-southeast-2 | docker login --username AWS --password-stdin 015248367786.dkr.ecr.ap-southeast-2.amazonaws.com\n```\n\nProceed to build the container image and upload it:\n\n```sh\nrepo=\"015248367786.dkr.ecr.ap-southeast-2.amazonaws.com\" \u0026\u0026 \\\nbuild=\"$(nix-build ./release.nix --attr docker)\" \u0026\u0026 \\\nloaded=\"$(docker load --input \"$build\")\" \u0026\u0026 \\\nname=\"$(cut -d':' -f2 \u003c\u003c\u003c \"$loaded\" | tr -d ' ')\" \u0026\u0026 \\\ntag=\"$(cut -d':' -f3 \u003c\u003c\u003c \"$loaded\")\" \u0026\u0026 \\\ndocker tag \"${name}:${tag}\" \"${repo}/http-demo:${tag}\" \u0026\u0026 \\\ndocker tag \"${name}:${tag}\" \"${repo}/http-demo:latest\" \u0026\u0026 \\\ndocker push \"${repo}/http-demo:${tag}\" \u0026\u0026 \\\ndocker push \"${repo}/http-demo:latest\"\n```\n\nBecause the container is built with an `Entrypoint`, set the `Command` to only the parameters.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmatrixai%2Fhttp-demo","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmatrixai%2Fhttp-demo","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmatrixai%2Fhttp-demo/lists"}