{"id":20275894,"url":"https://github.com/trendev/helloworld","last_synced_at":"2026-04-09T07:58:28.587Z","repository":{"id":110249890,"uuid":"244345345","full_name":"trendev/helloworld","owner":"trendev","description":"simple helloworld example build on NodeJS \u0026 Kubernetes","archived":false,"fork":false,"pushed_at":"2024-10-19T13:13:31.000Z","size":81,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-01-14T06:30:19.685Z","etag":null,"topics":["docker","kubernetes","nodejs"],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/trendev.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-03-02T10:42:08.000Z","updated_at":"2024-10-19T13:18:27.000Z","dependencies_parsed_at":"2025-01-14T06:40:25.975Z","dependency_job_id":null,"html_url":"https://github.com/trendev/helloworld","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/trendev%2Fhelloworld","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/trendev%2Fhelloworld/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/trendev%2Fhelloworld/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/trendev%2Fhelloworld/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/trendev","download_url":"https://codeload.github.com/trendev/helloworld/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":241767781,"owners_count":20017047,"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":["docker","kubernetes","nodejs"],"created_at":"2024-11-14T13:11:41.002Z","updated_at":"2025-12-31T01:03:10.707Z","avatar_url":"https://github.com/trendev.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"\n# Node.js Express Server\n\nThis is a simple Node.js application using the Express framework, Docker and Kubernetes. It provides basic health-check routes and retrieves system information such as IP addresses and hostname.\n\n## Features\n\n- **Health check endpoint** to verify the status of the application.\n- **System information endpoint** that returns the namespace, hostname, IP address, and a timestamp.\n- **Logging** with `morgan` to monitor HTTP requests.\n- Uses `os` module to retrieve network interface details.\n\n## Prerequisites\n\n- Node.js (v12.x or higher)\n- npm (v6.x or higher)\n\n## Installation\n\n1. Clone this repository.\n\n   ```bash\n   git clone \u003crepository_url\u003e\n   ```\n\n2. Navigate to the project directory.\n\n   ```bash\n   cd \u003cproject_directory\u003e\n   ```\n\n3. Install the dependencies.\n\n   ```bash\n   npm install\n   ```\n\n## Environment Variables\n\nThe application can use the following environment variables:\n\n- `PORT`: Port on which the server will listen (default is `9000`).\n- `MY_POD_NAMESPACE`: The namespace for the pod (defaults to `docker`).\n- `MY_POD_NAME`: The hostname of the pod (defaults to system hostname).\n- `MY_POD_IP`: The IP address of the pod (defaults to the machine's network interface addresses).\n\n## Usage\n\n1. To start the server, run the following command:\n\n   ```bash\n   node index.js\n   ```\n\n2. The application will be running on the port specified by the `PORT` environment variable (or `9000` by default).\n\n## API Endpoints\n\n### GET `/health`\n\nThis endpoint returns the health status of the server.\n\n**Response:**\n\n```json\n{\n  \"status\": \"ok\",\n  \"message\": \"we are up and running 😘\"\n}\n```\n\n### GET `/`\n\nThis endpoint returns system information such as the namespace, hostname, IP addresses, and a timestamp.\n\n**Response:**\n\n```json\n{\n  \"status\": \"ok\",\n  \"namespace\": \"docker\",\n  \"hostname\": \"\u003chostname\u003e\",\n  \"ip\": [\n    { \"eth0\": \"192.168.1.100\" }\n  ],\n  \"timestamp\": 1684567890123\n}\n```\n\n## Logging\n\nThe server uses the `morgan` library for request logging. Logs are printed in the console in the \"dev\" format.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftrendev%2Fhelloworld","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftrendev%2Fhelloworld","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftrendev%2Fhelloworld/lists"}