https://github.com/barbapapazes/reproduction-cloudflare-bearer
https://github.com/barbapapazes/reproduction-cloudflare-bearer
Last synced: 25 days ago
JSON representation
- Host: GitHub
- URL: https://github.com/barbapapazes/reproduction-cloudflare-bearer
- Owner: Barbapapazes
- Created: 2024-05-21T05:11:25.000Z (about 1 year ago)
- Default Branch: main
- Last Pushed: 2024-05-21T05:18:39.000Z (about 1 year ago)
- Last Synced: 2025-06-19T03:45:52.272Z (27 days ago)
- Language: TypeScript
- Size: 83 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
This is a small reproduction for a possible bug in Cloudflare or ofetch.
You need to build the nuxt app and deploy it on cloudflare
```bash
NITRO_PRESET=cloudflare_pages npm run build
``````bash
npx wrangler pages deploy dist/
```Then you can start the `server.mjs` file.
```bash
node server.mjs # Start on port 4000
```The Nuxt application will make a request to the endpoint using the bearer token and the response will be logged to the console.
Use cloudflare tunnel to expose the small node server to the internet. (used to verify the issue from cloudflare)
```bash
cloudflared tunnel --url http://localhost:4000
```Get the tunnel name and set the `NUXT_ENDPOINT` environment variable to the tunnel name.
```bash
NUXT_ENDPOINT=.trycloudflare.com
```Setup the bearer token:
```bash
NUXT_CIRCLE_API_KEY=
```