Skip to content

Commit

Permalink
[doc] rename rest of the request handlers (#5567)
Browse files Browse the repository at this point in the history
* changed request handlers name in doc

* update adapter-cloudflare docs
  • Loading branch information
aantusahaa authored Jul 16, 2022
1 parent 9502d92 commit 13c3fea
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion documentation/docs/02-web-standards.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ The [`Headers`](https://developer.mozilla.org/en-US/docs/Web/API/Headers) interf
// @errors: 2461
/// file: src/routes/what-is-my-user-agent.js
/** @type {import('@sveltejs/kit').RequestHandler} */
export function get(event) {
export function GET(event) {
// log all headers
console.log(...event.request.headers);

Expand Down
4 changes: 2 additions & 2 deletions documentation/docs/16-types.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ The `RequestHandler` and `Load` types both accept a `Params` argument allowing y
* bar: string;
* baz: string
* }>} */
export async function get({ params }) {
export async function GET({ params }) {
// ...
}
```
Expand Down Expand Up @@ -57,7 +57,7 @@ export type RequestHandler<Body = any> = GenericRequestHandler<
// @errors: 2355
// ---cut---
/** @type {import('./__types/[baz]').RequestHandler} */
export async function get({ params }) {
export async function GET({ params }) {
// ...
}
```
Expand Down
2 changes: 1 addition & 1 deletion documentation/docs/17-seo.md
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ export default config;

```js
/// file: src/routes/sitemap.xml.js
export async function get() {
export async function GET() {
return {
headers: {
'Content-Type': 'application/xml'
Expand Down
2 changes: 1 addition & 1 deletion packages/adapter-cloudflare-workers/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ wrangler publish
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:

```js
export async function post({ request, platform }) {
export async function POST({ request, platform }) {
const x = platform.env.YOUR_DURABLE_OBJECT_NAMESPACE.idFromName('x');
}
```
Expand Down
2 changes: 1 addition & 1 deletion packages/adapter-cloudflare/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ When configuring your project settings, you must use the following settings:
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:

```js
export async function post({ request, platform }) {
export async function POST({ request, platform }) {
const x = platform.env.YOUR_DURABLE_OBJECT_NAMESPACE.idFromName('x');
}
```
Expand Down

0 comments on commit 13c3fea

Please sign in to comment.