minimusubi
03/07/2022, 9:44 AMjson
{
"routes": {
"GET /api/stop/search/near/:latitude]/[longitude": {
"module": [
"api/stop/search/near/[latitude]/[longitude].ts:onRequestGet"
]
}
},
"baseURL": "/"
}
csmykay
03/07/2022, 7:32 PMcsmykay
03/07/2022, 8:31 PMJames
03/07/2022, 8:33 PMwaitUntil
or similar. I believe there will be a better way to get Functions logs in the future, similar to normal Workers, once Functions hits GA.justinhook
03/08/2022, 12:22 AMcojo
03/08/2022, 3:37 AMMAXOUXAX
03/08/2022, 5:27 PMHardAtWork
03/08/2022, 5:27 PMMAXOUXAX
03/08/2022, 5:32 PMKing Mesal
03/09/2022, 3:19 PMWhen naming your files:
[name] is a placeholder for a single path segment.
[[name]] matches any depth of route below this point.
there are examples provided saying
/api/todos/* => ./functions/api/todos/[id].ts
In turn, the URL segment(s) that match the placeholder will be available under the context.params object using the filename placeholder as the key.
Are there any code examples that show how to use that context.params object and how to properly reference the parts / pieces?VV
03/09/2022, 10:20 PMOnly absolute URLs are supported
error when using fetch and gatsby? I can't seem to find how to get the URL of a preview build to fix this error on production (using relative URLs gives this error too).Artis3n
03/10/2022, 3:39 AMaxios: {
baseURL: 'http://localhost:3000/',
browserBaseURL: 'http://localhost:3000/',
},
publicRuntimeConfig: {
axios: {
browserBaseURL: process.env.BROWSER_BASE_URL,
},
},
privateRuntimeConfig: {
axios: {
baseURL: process.env.BASE_URL,
},
},
I set the env vars to the production URL in the Pages settings. So the API functions work on the production deployment, but all testing from PRs is broken. I don't see env vars (https://developers.cloudflare.com/pages/platform/build-configuration/#environment-variables) available today that would help me resolve this. Is there a way?Artis3n
03/10/2022, 3:42 AMonRequestPost()
function set up and I'm logging the full context I receive. I don't see the POST body parameters anywhere. Shouldn't they be under context.request.body
? I POST an object containing the fields "page" and "token" and context.request.body
is the object { locked: false }
Any logs I can collect to help identify what is going on? POSTing like this from a Nuxt site:
await $axios.$post('/api/checkToken', payload)
minimusubi
03/10/2022, 6:09 AM/functions/api/todos/[id].ts
, if we were to visit the URL mydomain.dev/api/todos/133
, then the context.params
object will contain an id
property that's set to "133"
. Effectively, context.params.id = "133"
jnordberg
03/10/2022, 9:20 AMrichardcooke
03/10/2022, 11:17 AM_worker.js
to server render a page, and it's stable and consistently fine. But if we smash the refresh button a few times it will 1102 worker resource limits exceed
. It recovers very quickly and then is consistently fine until the you aggressively refresh again. It also doesn't seem to affect other users in the same location, so if one user pushes the worker to 1102
, it seems to be isolated to that user. Is this expected/some kind of protection against users doing that? Or are we likely over/too close to the limits and actually pushing them over? It's difficult to tell whats going on with just the daily usage insights email.Walshy | Pages
03/10/2022, 11:20 AMIsaac McFadyen | YYZ01
03/10/2022, 1:19 PMArtis3n
03/10/2022, 1:29 PMvivekpatt_whyd
03/10/2022, 2:39 PMrichardcooke
03/10/2022, 2:56 PMTravisFrank
03/10/2022, 5:12 PMfunctions
dir with no issue, then removed the functions
dir in a later build. I added the functions
dir back in my most recent build, but now I'm running into Failed: an internal error occurred
when deploying. Has anyone run into this before / quick fixes? Thanks so much!TravisFrank
03/10/2022, 5:42 PMWalshy | Pages
03/10/2022, 5:43 PMprocess
or `global`s in there. What's the deployment ID?vivekpatt_whyd
03/10/2022, 5:45 PMWalshy | Pages
03/10/2022, 5:46 PM/nl/index.html
your Function isn't firing?TravisFrank
03/10/2022, 5:50 PMWalshy | Pages
03/10/2022, 5:50 PMTravisFrank
03/10/2022, 5:51 PMWalshy | Pages
03/10/2022, 5:51 PM