Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/barbapapazes/reproduction-cloudflare-bearer
https://github.com/barbapapazes/reproduction-cloudflare-bearer
Last synced: 1 day ago
JSON representation
- Host: GitHub
- URL: https://github.com/barbapapazes/reproduction-cloudflare-bearer
- Owner: Barbapapazes
- Created: 2024-05-21T05:11:25.000Z (7 months ago)
- Default Branch: main
- Last Pushed: 2024-05-21T05:18:39.000Z (7 months ago)
- Last Synced: 2024-12-20T11:13:03.395Z (3 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=
```