{"id":37789343,"url":"https://github.com/spectrocloud/hello-universe-api","last_synced_at":"2026-01-16T15:15:25.468Z","repository":{"id":103555537,"uuid":"583368948","full_name":"spectrocloud/hello-universe-api","owner":"spectrocloud","description":"A Spectro Cloud demo application. This is the API server for the Hello Universe app.","archived":false,"fork":false,"pushed_at":"2026-01-02T16:16:50.000Z","size":904,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":5,"default_branch":"main","last_synced_at":"2026-01-08T20:44:51.255Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mpl-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/spectrocloud.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":"CODEOWNERS","security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2022-12-29T15:16:17.000Z","updated_at":"2026-01-02T16:16:52.000Z","dependencies_parsed_at":"2024-09-06T15:38:13.298Z","dependency_job_id":null,"html_url":"https://github.com/spectrocloud/hello-universe-api","commit_stats":null,"previous_names":[],"tags_count":15,"template":false,"template_full_name":null,"purl":"pkg:github/spectrocloud/hello-universe-api","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/spectrocloud%2Fhello-universe-api","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/spectrocloud%2Fhello-universe-api/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/spectrocloud%2Fhello-universe-api/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/spectrocloud%2Fhello-universe-api/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/spectrocloud","download_url":"https://codeload.github.com/spectrocloud/hello-universe-api/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/spectrocloud%2Fhello-universe-api/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28479406,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-16T11:59:17.896Z","status":"ssl_error","status_checked_at":"2026-01-16T11:55:55.838Z","response_time":107,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":[],"created_at":"2026-01-16T15:15:25.003Z","updated_at":"2026-01-16T15:15:25.457Z","avatar_url":"https://github.com/spectrocloud.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![semantic-release: angular](https://img.shields.io/badge/semantic--release-angular-e10079?logo=semantic-release)](https://github.com/semantic-release/semantic-release)\n![Coverage](https://img.shields.io/badge/Coverage-42.6%25-yellow)\n\n# Hello Universe API\n\nA Spectro Cloud demo application. This is the API server for the [Hello Universe](https://github.com/spectrocloud/hello-universe) app.\n\n\u003cp align=\"center\"\u003e\n\u003cimg src=\"./static/img/spectronaut.png\" alt=\"drawing\" width=\"400\"/\u003e\n\u003c/p\u003e\n\n# Overview\n\nThe [Hello Universe](https://github.com/spectrocloud/hello-universe) app includes an API server that expands the capabilities of the application. The API server requires a Postgres database to store and retrieve data. Use the [Hello Universe DB](https://github.com/spectrocloud/hello-universe-db) container for simple integration with a Postgres database.\n\n# Endpoints\n\nA Postman collection is available to help you explore the API. Review the [Postman collection](./tests/postman_collection.json) to get started.\n\n# Prerequisites\nEnsure [Docker Desktop](https://www.docker.com/products/docker-desktop/) on your local machine is available. \n\n- Use the following command and ensure you receive an output displaying the version number.\n    ```shell\n    docker version\n    ```\n    \nAlternatively, you can install [Podman](https://podman.io/docs/installation).\n\n- If you are not using a Linux operating system, create and start the Podman Machine in your local environment. Otherwise, skip this step.\n    ```shell\n    podman machine init\n    podman machine start\n    ```\n- Use the following command and ensure you receive an output displaying the installation information.\n    ```shell\n    podman info\n    ```\n\n# Usage\n\nThe quickest method to start the API server locally is by using the Docker image.\n\n```shell\ndocker pull ghcr.io/spectrocloud/hello-universe-api:1.1.0\ndocker run -p 3000:3000 ghcr.io/spectrocloud/hello-universe-api:1.1.0\n```\n\nIf you choose Podman, you can use the following commands.\n\n```shell\npodman pull ghcr.io/spectrocloud/hello-universe-api:1.1.0\npodman run -p 3000:3000 ghcr.io/spectrocloud/hello-universe-api:1.1.0\n```\n\nTo start the API server you must have connectivity to a Postgres instance. Use [environment variables](#environment-variables) to customize the API server start parameters.\n\n## Environment Variables\n\nThe API server accepts the following environment variables.\n\n| Variable        | Description                                                                                                                                                                 | Default    |\n| --------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------- |\n| `PORT`          | The port number the application will listen on.                                                                                                                             | `3000`     |\n| `HOST`          | The host value name the API server will listen on.                                                                                                                          | `0.0.0.0`  |\n| `DB_NAME`       | The database name.                                                                                                                                                          | `counter`  |\n| `DB_USER`       | The database user name to use for queries.                                                                                                                                  | `postgres` |\n| `DB_HOST`       | The hostname or url to the database.                                                                                                                                        | `0.0.0.0`  |\n| `DB_PASSWORD`   | The database password.                                                                                                                                                      | `password` |\n| `DB_ENCRYPTION` | The Postgres [ssl mode](https://www.postgresql.org/docs/current/libpq-ssl.html) behavior to enable. Allowed values are: `require`, `verify-full`, `verify-ca`, or `disable` | `disable`  |\n| `DB_INIT`       | Set to `true` if you want the API server to create the required database schema and tables in the target database.                                                          | `false`    |\n| `AUTHORIZATION` | Set to `true` if you want the API server to require authorization tokens in the request.                                                                                    | `false`    |\n\n## Authorization\n\nThe API can be enabled with authorization which results in all requests requiring an authorization header with a token. An anonymous token is available:\n\n```shell\n931A3B02-8DCC-543F-A1B2-69423D1A0B94\n```\n\nTo enable authorization for the API set the environment variable `AUTHORIZATION` to `true`.\nEnsure all API requests have an `Authorization` header with the Bearer token.\n\n```shell\ncurl --location --request POST 'http://localhost:3000/api/v1/counter' \\\n--header 'Authorization: Bearer 931A3B02-8DCC-543F-A1B2-69423D1A0B94'\n```\n\n\u003e [!NOTE]\n\u003e\n\u003e Authorization does not apply to the `/health` endpoint.\n\n## Image Verification\n\nWe sign our images through [Cosign](https://docs.sigstore.dev/signing/quickstart/). Review the [Image Verification](./docs/image-verification.md) page to learn more.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fspectrocloud%2Fhello-universe-api","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fspectrocloud%2Fhello-universe-api","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fspectrocloud%2Fhello-universe-api/lists"}