br33zyk1lla
01/07/2024, 8:14 PMmr.goodman
01/08/2024, 2:12 AMjs
import { Router } from 'itty-router'; const router = Router()
order_data = [];
//admin only
router.get("/order", async (req) => {
return new Response(JSON.stringify(order_data));
});
ceifa
01/08/2024, 11:51 AMMcSneaky
01/08/2024, 2:28 PMts
import { Router } from 'itty-router';
const router = Router();
router.get('/edge/backporter', async (request) => {
request.query = '?foobar' // modify request
// Set URL to specific URL in other worker
request.url = '/edge/v1' // Error, cannot set read-only property
return env.BINDING.fetch(request);
}
And on BINDING
worker I have router that responds to certain URL only
https://example.com/edge/v1
ts
import { Router } from 'itty-router';
const router = Router();
router.get('/edge/v1', async (request) => { ... }
I'd like to make sure request from first worker ends up in /edge/v1
, but it never does, since I can't change request URL, nor can I request.clone()
, since then URL would match /edge/backporter
and not /edge/v1
Is anything like this possible?mitya2364
01/08/2024, 6:01 PM{
command: null,
rowCount: null,
oid: null,
rows: Array(0),
fields: Array(0)
...
}
All other queries work fine, as I say. So I'm sat here refreshing and endpoint and sometimes seeing data and sometimes not (with no code changes).
This is happening while running my app locally (with --remote
) so HD is being used. So I assume this is a HD issue, though perhaps it's at a Workers/Wrangler level for all I know. I could disable HD caching, but then that presumably defeats the point of HD?
Any help is greatly appreciated as this is blocking me at the mo! Thanks in advance.alexander9602
01/09/2024, 2:52 PMTolmieme
01/10/2024, 7:03 AMbirensz
01/10/2024, 12:51 PMjshuff
01/10/2024, 1:04 PMhzia
01/10/2024, 2:38 PMts
fetch('WORKER_URL', {method: 'GET'}).then((response) => response.json()).then((json) => {
console.log(json);
}).catch((error) => {
console.error(error);
});
My worker is currently just default with the Response Hello world due to not knowing what to do.colearendt
01/11/2024, 2:36 AMcurl -i https://cdn.btst.io/test.html
HTTP/2 200
date: Thu, 11 Jan 2024 02:34:45 GMT
content-length: 0
access-control-allow-origin: *
vary: Origin
access-control-allow-credentials: true
access-control-allow-headers: Content-Type, Vary, Origin, Referer, User-Agent, Authorization
access-control-allow-methods: GET, POST, PUT, DELETE, OPTIONS, PATCH, HEAD
report-to: {"endpoints":[{"url":"https:\/\/a.nel.cloudflare.com\/report\/v3?s=8OA78wCnvcRLW8CC5ljmtce%2BUhoPFbwNekVtEOQFJR2pMlYT5PVokesuCbId8U2u05wrqi3%2FkxP3kUy3K92R%2BvEg3w7XGcMk5vQraiHBgoKxbYMbUfBYchbrM4woyQ%3D%3D"}],"group":"cf-nel","max_age":604800}
nel: {"success_fraction":0,"report_to":"cf-nel","max_age":604800}
server: cloudflare
cf-ray: 8439c3330d605cae-RDU
alt-svc: h3=":443"; ma=86400
I don't know how long this has been happening, but I don't see any evidence reported anywhere?
Is this an issue on y'all's side?98thpixel
01/11/2024, 4:45 AMendymion1818
01/11/2024, 11:03 AM${env.SECRET_NAME}
and {context.env.SECRET_NAME}
, neither of which is resolving.
Does anyone know what might be the issue? Since the documentation mentions both approaches, I am suspicious that either might be incorrect.sik.page
01/11/2024, 12:37 PMvinomancer
01/11/2024, 1:37 PMendymion1818
01/11/2024, 2:22 PMpara.doxical
01/11/2024, 4:31 PMendymion1818
01/11/2024, 4:48 PMexport default
causes the error
Error: No routes found when building Functions directory
endymion1818
01/11/2024, 5:08 PM<form method="POST" action="/functions/send-email"
However Wrangler keeps erroring with "No response"
My function is:
export async function onRequest() {
return Response.redirect('/')
}
Please tell me what I'm doing wrongrust
01/11/2024, 11:20 PMts
await writer.write(encoder.encode('<h1>Hello world!</h1>'));
Is this the right way of appending strings or is it possible to remove the encoder.encode
call of the TextEndoer
?vikiival | KodaDot
01/12/2024, 10:36 AMendymion1818
01/12/2024, 12:16 PMmitya2364
01/12/2024, 1:42 PM--remote
flag active. If I quit and restart the server, all is fine.
Is this is a known issue, and should I be concerned about this ultimately happening when I host my app for production?ACS
01/13/2024, 3:20 AMrajiv 🍉
01/13/2024, 12:15 PMAlka
01/13/2024, 4:30 PM.crossbeau
01/13/2024, 5:57 PMjax16276
01/13/2024, 6:49 PMzank.it
01/13/2024, 10:13 PM_middleware.ts
file (code on first comment), having "@cloudflare/pages-plugin-mailchannels": "^0.1.2"
on the dependencies
- On the form I added the attribute data-static-form-name="contact"
- Added includes to my existing spf record so now look like this v=spf1 include:_spf.mx.cloudflare.net include:relay.mailchannels.net include:_spf.google.com -all
- Generated DKIM Credentials following the guide https://developers.cloudflare.com/pages/functions/plugins/mailchannels/#generate-dkim-credentials
- Added to environment variables (see image)
- Added the TXT record mailchannels._domainkey (see image)
- Added domain lockdown (TXT _mailchannels
) with both workers domain and my domain as stated here https://community.cloudflare.com/t/introducing-mailchannels-domain-lockdown/523913/5: `v=mc1 cfid=majestico.workers.dev cfid=majestico.it `(and see image)
Now when i try to send email from https://majestico.it/contact/ I get the error "Could not send your email. Please try again."
Am I missing something?
Is there a way to debug this problem and get a significant error?
ThanksGtadictos21
01/13/2024, 10:22 PM