{"id":15383697,"url":"https://github.com/knownasilya/index-html-loader","last_synced_at":"2026-01-08T00:57:23.019Z","repository":{"id":42185889,"uuid":"170536073","full_name":"knownasilya/index-html-loader","owner":"knownasilya","description":"Load and cache index.html using GCP PubSub, works great with ember-cli-deploy","archived":false,"fork":false,"pushed_at":"2024-06-10T21:40:55.000Z","size":469,"stargazers_count":1,"open_issues_count":4,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-02-05T16:49:18.805Z","etag":null,"topics":["deployment","ember-cli-deploy","pubsub"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/knownasilya.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":null,"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":"2019-02-13T15:59:53.000Z","updated_at":"2022-01-15T15:47:33.000Z","dependencies_parsed_at":"2024-10-18T16:49:43.129Z","dependency_job_id":null,"html_url":"https://github.com/knownasilya/index-html-loader","commit_stats":{"total_commits":38,"total_committers":2,"mean_commits":19.0,"dds":0.2894736842105263,"last_synced_commit":"e0d45ebd067c75649561cd70ccddbb72b78c73e3"},"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/knownasilya%2Findex-html-loader","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/knownasilya%2Findex-html-loader/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/knownasilya%2Findex-html-loader/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/knownasilya%2Findex-html-loader/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/knownasilya","download_url":"https://codeload.github.com/knownasilya/index-html-loader/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246335774,"owners_count":20760916,"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":["deployment","ember-cli-deploy","pubsub"],"created_at":"2024-10-01T14:39:22.956Z","updated_at":"2026-01-08T00:57:22.994Z","avatar_url":"https://github.com/knownasilya.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# index-html-loader\n\nLoad `index.html` from some source and compile it arbitrary data using handlebars.\nSubsequent requests will use the cache. Cache will be reset and prewarmed\nwhen the subscription is triggered in GCP PubSub.\n\nThis library works great with [ember-cli-deploy] and specifically the following plugins:\n\n- https://github.com/knownasilya/ember-cli-deploy-gcloud-pubsub\n- https://github.com/knownasilya/ember-cli-deploy-gcloud-storage\n- https://github.com/mwpastore/ember-cli-deploy-sql\n\n## Example\n\n```js\nimport setupLoader from 'index-html-loader';\nimport pkg from './package.json';\n\nconst pubsubOptions = { /* ... */ };\nconst indexHtml = setupLoader({\n  project: pkg.name,\n  version: pkg.version,\n  env: process.env.NODE_ENV,\n  // Make sure each pod is invalidated in kubernetes\n  subscriptionPostfix: process.env.GCP_POD_ID,\n  pubsubOptions,\n  findRevision: async (project, revisionId) =\u003e {\n    return await loadHtml(project, revisionId);\n  }\n});\n\nrouter.get('/*', async function (req, res) {\n  let data = await loadSomeData();\n  let html = await indexHtml.load(data, req.query.revisionKey);\n\n  res.header('Cache-Control', 'private, no-cache, no-store, must-revalidate');\n  res.header('Expires', '-1');\n  res.header('Pragma', 'no-cache');\n  res.send(html);\n});\n```\n\n## Debug\n\nYou can log details from this library by adding the following\nenvironment variable to your start/watch script.\n\n```sh\nDEBUG=index-html-loader npm start\n```\n\n[ember-cli-deploy]: http://ember-cli-deploy.com/","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fknownasilya%2Findex-html-loader","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fknownasilya%2Findex-html-loader","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fknownasilya%2Findex-html-loader/lists"}