{"id":16163561,"url":"https://github.com/stockbal/ui5-middleware-global-variables","last_synced_at":"2025-07-07T17:40:17.401Z","repository":{"id":57385283,"uuid":"280424644","full_name":"stockbal/ui5-middleware-global-variables","owner":"stockbal","description":"custom ui5 server middleware for global variables","archived":false,"fork":false,"pushed_at":"2020-07-17T13:19:51.000Z","size":11,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2024-04-25T08:02:41.169Z","etag":null,"topics":["ui5-tooling"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","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/stockbal.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}},"created_at":"2020-07-17T12:57:23.000Z","updated_at":"2020-07-20T12:22:51.000Z","dependencies_parsed_at":"2022-08-25T17:11:38.971Z","dependency_job_id":null,"html_url":"https://github.com/stockbal/ui5-middleware-global-variables","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/stockbal%2Fui5-middleware-global-variables","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stockbal%2Fui5-middleware-global-variables/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stockbal%2Fui5-middleware-global-variables/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stockbal%2Fui5-middleware-global-variables/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/stockbal","download_url":"https://codeload.github.com/stockbal/ui5-middleware-global-variables/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247595376,"owners_count":20963941,"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":["ui5-tooling"],"created_at":"2024-10-10T02:43:57.345Z","updated_at":"2025-04-07T04:38:47.662Z","avatar_url":"https://github.com/stockbal.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![npm version](https://badge.fury.io/js/ui5-middleware-global-variables.svg)](https://badge.fury.io/js/ui5-middleware-global-variables)\n\n# UI5 global variables middleware\n\nMiddleware for [ui5-server](https://github.com/SAP/ui5-server), for accessing globally injected variables.\n\n## Install\n\n```bash\nnpm install ui5-middleware-global-variables --save-dev\n```\n\n## Configuration options (in `$yourapp/ui5.yaml`)\n\n- rootPath: `string`\n  the root path to the static resources on your system\n\n## Usage\n\n1. Define the dependency in `$yourapp/package.json`:\n\n```json\n\"devDependencies\": {\n    // ...\n    \"ui5-middleware-global-variables\": \"*\"\n    // ...\n},\n\"ui5\": {\n  \"dependencies\": [\n    // ...\n    \"ui5-middleware-global-variables\",\n    // ...\n  ]\n}\n```\n\n\u003e As the devDependencies are not recognized by the UI5 tooling, they need to be listed in the `ui5 \u003e dependencies` array. In addition, once using the `ui5 \u003e dependencies` array you need to list all UI5 tooling relevant dependencies.\n\n2. configure it in `$yourapp/ui5.yaml`:  \n\n```yaml\nserver:\n  customMiddleware:\n  - name: ui5-middleware-global-variables\n    afterMiddleware: compression\n    configuration:\n      debug: true\n```\n\n## How it works\n\nYou insert the following `script`-tag at the end of the `head`-tag of the `*.html` file you use for your dev server.\n\n```html\n\u003cscript src=\"/ui5-global-vars.js\"\u003e\u003c/script\u003e\n```\n\nThe middleware will then inject the source code into the script which will convert all `.env` Variables that start with **`UI5_GLOBAL_VAR__`** into a global object called `$ui5GlobalVariables`.  \nThis object has only one method called `get` which expects the id of a global variable (defined in `.env`)\n\n## License\n\nThis work is [licensed](../../LICENSE) under Apache 2.0.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstockbal%2Fui5-middleware-global-variables","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fstockbal%2Fui5-middleware-global-variables","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstockbal%2Fui5-middleware-global-variables/lists"}