{"id":20726020,"url":"https://github.com/logotip4ik/nuxt-cloudflare-headers","last_synced_at":"2025-04-23T18:40:32.355Z","repository":{"id":45467087,"uuid":"512169194","full_name":"logotip4ik/nuxt-cloudflare-headers","owner":"logotip4ik","description":"Auto generate cloudflare headers with Nuxt3","archived":false,"fork":false,"pushed_at":"2023-02-03T19:32:21.000Z","size":434,"stargazers_count":4,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-04-14T04:08:47.829Z","etag":null,"topics":["cloudflare","headers","nuxt3"],"latest_commit_sha":null,"homepage":"https://www.npmjs.com/package/@logotip4ik_/nuxt-cloudflare-headers","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/logotip4ik.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":"2022-07-09T11:31:48.000Z","updated_at":"2024-06-21T07:38:00.000Z","dependencies_parsed_at":"2023-02-18T10:18:23.791Z","dependency_job_id":null,"html_url":"https://github.com/logotip4ik/nuxt-cloudflare-headers","commit_stats":null,"previous_names":[],"tags_count":20,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/logotip4ik%2Fnuxt-cloudflare-headers","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/logotip4ik%2Fnuxt-cloudflare-headers/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/logotip4ik%2Fnuxt-cloudflare-headers/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/logotip4ik%2Fnuxt-cloudflare-headers/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/logotip4ik","download_url":"https://codeload.github.com/logotip4ik/nuxt-cloudflare-headers/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":250492431,"owners_count":21439528,"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":["cloudflare","headers","nuxt3"],"created_at":"2024-11-17T04:22:47.293Z","updated_at":"2025-04-23T18:40:32.325Z","avatar_url":"https://github.com/logotip4ik.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# ☁ Nuxt3 Cloudflare Headers\n\n[![npm version][npm-version-src]][npm-version-href]\n[![npm downloads][npm-downloads-src]][npm-downloads-href]\n\n\u003e Cloudflare headers Module for Nuxt3\n\n[📖 **Release Notes**](https://github.com/logotip4ik/nuxt-cloudflare-headers/releases)\n\n## Features\n\n- 👌 Easy to use\n- ✅ Nuxt3 compatible\n- 🧾 Supports static generation\n\n## Setup\n\n1. Add `@logotip4ik_/nuxt-cloudflare-headers` dependency to your project\n\n```bash\nyarn add @logotip4ik_/nuxt-cloudflare-headers # or npm install @logotip4ik_/nuxt-cloudflare-headers\n```\n\n2. Add `@logotip4ik_/nuxt-cloudflare-headers` to the `modules` section of `nuxt.config.js`\n\n```js\n// nuxt.config.js\nimport { defineNuxtConfig } from \"nuxt\";\nimport cloudflareHeaders from \"@logotip4ik_/nuxt-cloudflare-headers\";\n\nexport default defineNuxtConfig({\n  modules: [\n    // With inlined options\n    [cloudflareHeaders, { \"/api\": { \"x-powered-by\": \"cloudflare\" } }],\n  ],\n});\n```\n\nOr a separate section `nuxt-cloudflare-headers` for module options:\n\n```js\n// nuxt.config.js\nimport { defineNuxtConfig } from \"nuxt\";\nimport cloudflareHeaders from \"@logotip4ik_/nuxt-cloudflare-headers\";\n\nexport default defineNuxtConfig({\n  modules: [cloudflareHeaders],\n\n  cloudflareHeaders: {\n    \"/*\": { \"some-cool\": \"header\" },\n  },\n});\n```\n\n## Documentation\n\n```js\n// nuxt.config.js\nimport { defineNuxtConfig } from \"nuxt\";\nimport cloudflareHeaders from \"@logotip4ik_/nuxt-cloudflare-headers\";\n\nexport default defineNuxtConfig({\n  modules: [cloudflareHeaders],\n\n  cloudflareHeaders: {\n    \"/*\": { \"some-cool\": \"header\", \"hello\": \"world\" },\n    \"/admin\": { \"some-cool\": false }, // detaching `some-cool` header from admin route\n  },\n});\n```\n\nIn `cloudflareHeaders` object key (`/*`, `/admin`) will be route matcher and array of objects or plain object will be actual header rules. Where `some-cool` will be header name and `header` will be header value. Also you can detach a header from route by providing `false` as value. So if you are generating your project with such a config, nuxt will prerender `_headers` file with this content inside:\n\n```text\n/*\n  some-cool: header\n  hello: world\n\n/admin\n  ! some-cool\n```\n\n\u003e For more features read [cloudflare docs about `_headers` file](https://developers.cloudflare.com/pages/platform/headers)\n\n## Development\n\n1. Clone this repository\n2. Run `npm run dev:prepare` to generate type stubs.\n3. Use `npm run dev` to start [playground](./playground) in development mode.\n\n## License\n\n[MIT License](./LICENSE)\n\n\u003c!-- Badges --\u003e\n\n[npm-version-src]: https://img.shields.io/npm/v/@logotip4ik_/nuxt-cloudflare-headers/latest.svg\n[npm-version-href]: https://npmjs.com/package/@logotip4ik_/nuxt-cloudflare-headers\n[npm-downloads-src]: https://img.shields.io/npm/dt/@logotip4ik_/nuxt-cloudflare-headers.svg\n[npm-downloads-href]: https://npmjs.com/package/@logotip4ik_/nuxt-cloudflare-headers\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flogotip4ik%2Fnuxt-cloudflare-headers","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flogotip4ik%2Fnuxt-cloudflare-headers","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flogotip4ik%2Fnuxt-cloudflare-headers/lists"}