Skip to content

Commit 13c3fea

Browse files
authored
[doc] rename rest of the request handlers (#5567)
* changed request handlers name in doc * update adapter-cloudflare docs
1 parent 9502d92 commit 13c3fea

File tree

5 files changed

+6
-6
lines changed

5 files changed

+6
-6
lines changed

documentation/docs/02-web-standards.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ The [`Headers`](https://developer.mozilla.org/en-US/docs/Web/API/Headers) interf
3232
// @errors: 2461
3333
/// file: src/routes/what-is-my-user-agent.js
3434
/** @type {import('@sveltejs/kit').RequestHandler} */
35-
export function get(event) {
35+
export function GET(event) {
3636
// log all headers
3737
console.log(...event.request.headers);
3838

documentation/docs/16-types.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ The `RequestHandler` and `Load` types both accept a `Params` argument allowing y
1616
* bar: string;
1717
* baz: string
1818
* }>} */
19-
export async function get({ params }) {
19+
export async function GET({ params }) {
2020
// ...
2121
}
2222
```
@@ -57,7 +57,7 @@ export type RequestHandler<Body = any> = GenericRequestHandler<
5757
// @errors: 2355
5858
// ---cut---
5959
/** @type {import('./__types/[baz]').RequestHandler} */
60-
export async function get({ params }) {
60+
export async function GET({ params }) {
6161
// ...
6262
}
6363
```

documentation/docs/17-seo.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ export default config;
5858

5959
```js
6060
/// file: src/routes/sitemap.xml.js
61-
export async function get() {
61+
export async function GET() {
6262
return {
6363
headers: {
6464
'Content-Type': 'application/xml'

packages/adapter-cloudflare-workers/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ wrangler publish
7474
The [`env`](https://developers.cloudflare.com/workers/runtime-apis/fetch-event#parameters) object, containing KV/DO namespaces etc, is passed to SvelteKit via the `platform` property along with `context` and `caches`, meaning you can access it in hooks and endpoints:
7575

7676
```js
77-
export async function post({ request, platform }) {
77+
export async function POST({ request, platform }) {
7878
const x = platform.env.YOUR_DURABLE_OBJECT_NAMESPACE.idFromName('x');
7979
}
8080
```

packages/adapter-cloudflare/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ When configuring your project settings, you must use the following settings:
5656
The [`env`](https://developers.cloudflare.com/workers/runtime-apis/fetch-event#parameters) object, containing KV/DO namespaces etc, is passed to SvelteKit via the `platform` property along with `context` and `caches`, meaning you can access it in hooks and endpoints:
5757

5858
```js
59-
export async function post({ request, platform }) {
59+
export async function POST({ request, platform }) {
6060
const x = platform.env.YOUR_DURABLE_OBJECT_NAMESPACE.idFromName('x');
6161
}
6262
```

0 commit comments

Comments
 (0)