{"id":22411056,"url":"https://github.com/smapiot/sample-pilet-service","last_synced_at":"2025-04-06T10:11:30.172Z","repository":{"id":35040503,"uuid":"192621792","full_name":"smapiot/sample-pilet-service","owner":"smapiot","description":"A simple Node.js sample pilet feed service for use with Piral. :rocket:","archived":false,"fork":false,"pushed_at":"2025-03-25T14:44:15.000Z","size":1363,"stargazers_count":36,"open_issues_count":2,"forks_count":23,"subscribers_count":4,"default_branch":"develop","last_synced_at":"2025-03-30T06:08:48.590Z","etag":null,"topics":["express","feed","hacktoberfest","microfrontend","nodejs","pilet","piral","service"],"latest_commit_sha":null,"homepage":"https://piral.io","language":"TypeScript","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/smapiot.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","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},"funding":{"github":["smapiot","FlorianRappl"]}},"created_at":"2019-06-18T22:42:58.000Z","updated_at":"2025-02-24T12:04:20.000Z","dependencies_parsed_at":"2024-03-28T16:30:15.632Z","dependency_job_id":"d3695a46-0288-4dad-bd34-42aa15bf0f59","html_url":"https://github.com/smapiot/sample-pilet-service","commit_stats":{"total_commits":91,"total_committers":7,"mean_commits":13.0,"dds":0.5604395604395604,"last_synced_commit":"5d7e0a4face3790822c48b823bf5c228ab8082a6"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/smapiot%2Fsample-pilet-service","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/smapiot%2Fsample-pilet-service/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/smapiot%2Fsample-pilet-service/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/smapiot%2Fsample-pilet-service/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/smapiot","download_url":"https://codeload.github.com/smapiot/sample-pilet-service/tar.gz/refs/heads/develop","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247464222,"owners_count":20942970,"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":["express","feed","hacktoberfest","microfrontend","nodejs","pilet","piral","service"],"created_at":"2024-12-05T13:12:54.553Z","updated_at":"2025-04-06T10:11:30.156Z","avatar_url":"https://github.com/smapiot.png","language":"TypeScript","funding_links":["https://github.com/sponsors/smapiot","https://github.com/sponsors/FlorianRappl"],"categories":[],"sub_categories":[],"readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/main/docs/assets/logo.png)](https://piral.io)\n\n# [Sample Pilet Feed](https://piral.io) \u0026middot; [![Build Status](https://smapiot.visualstudio.com/piral/_apis/build/status/smapiot.sample-pilet-service?branchName=main)](https://smapiot.visualstudio.com/piral/_build/latest?definitionId=14\u0026branchName=main) [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/main/LICENSE) [![GitHub Tag](https://img.shields.io/github/tag/smapiot/piral.svg)](https://github.com/smapiot/piral/releases) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nA simple Node.js sample pilet feed service for use with Piral. If you don't want to play around with a feed service locally then use the (free) community edition of the [official Piral Feed Service](https://feed.piral.cloud/). Alternatively, if you are interested in more beef such as running the official Piral Feed Service in your environment or accessing premium features in the online edition then have a look at [Piral Cloud website](https://www.piral.cloud/).\n\n## Getting Started\n\nFor running this sample locally all you need to do is running:\n\n```sh\nnpm i \u0026\u0026 npm start\n```\n\n**Remark**: This sample requires Node.js and NPM. The used port is `9000`, which could be re-configured easily (e.g., via an environment variable `PORT`).\n\n## Auth Keys\n\nFor publishing a Pilet a handful premade keys have been added (file: `src/auth/keys.ts`):\n\n```plain\ndf133a512569cbc85f69788d1b7ff5a909f6bcfe1c9a2794283a2fc35175882c\nda91e6a8aeee998b7d6b0701486e4909d2ee14fbcc0af5de601c1d09982141d5\nf94fa7067e0299679af2b1dda6f1835cd7ed03a43c104446954b11ec7b1509d0\nedf8c9275873ca743394b3367e67149d6fda5306b577113fbf1ff4f191de69e4\nad647bdc23b7437b8fa8f27c3e2d3f70fbb493c53e9160e07d37a98df333b188\n```\n\nEither change the file when using this service in any non-local infrastructure or set the environment variable `PILET_API_KEYS` with comma separated values (e.g., `A,B,C` uses three keys `A`, `B`, and `C` instead).\n\n## Pilet Database\n\nFor this simple sample everything is kept in memory. If you want to change this behavior to store the pilets also in a database / some storage you will need to modify the `src/db/index.ts` file.\n\n**Remark**: The file has been prepared in such a sense that all exposed functions already return promises.\n\n## Reported URL\n\nFor the pilets the reported URL is `http://localhost/...` unless changed via `src/constants.ts`. For simplicity, a resolution algorithm based on standard environment variables is already active.\n\n| Variable               | Meaning                                                                         |\n|------------------------|---------------------------------------------------------------------------------|\n| WEBSITE_HOSTNAME       | The name of the host, e.g., `localhost`                                         |\n| PORT                   | The port, otherwise falling back to 9000                                        |\n| HTTPS                  | Is HTTPS active, otherwise falling back to HTTP                                 |\n| PILETS_SNAPSHOT        | Defines the path of the database snapshot directory                             |\n| HTTP_X_FORWARDED_PROTO | The used protocol (e.g., `http`), otherwise falling back to the `HTTPS` setting |\n\n## Snapshot\n\nBy default, the service creates a directory called `pilets` in the current working directory. If you don't want this (i.e., no snapshot should be created) then set the `PILETS_SNAPSHOT` environment variable to an empty string i.e., `PILETS_SNAPSHOT=\"\"`. Otherwise, if you want to use another directory, set the variable to a directory, e.g., `PILETS_SNAPSHOT=/tmp/pilets`.\n\n## Usage via NPM\n\nAlternatively, if you want to use the service only locally to play around you can also install and run the package via NPM:\n\n```sh\nnpx sample-pilet-service\n```\n\nYou could also install it globally:\n\n```sh\nnpm i sample-pilet-service -g\n```\n\nThis will enable a new command `sample-pilet-service` to be invoked on the command line shell.\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsmapiot%2Fsample-pilet-service","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsmapiot%2Fsample-pilet-service","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsmapiot%2Fsample-pilet-service/lists"}