docs: add _ prefix to unused requests params (#1007)

- add types to handlers in the Getting Started section to align with the
examples in the Concepts section
- prefix unused arguments with `_` as suggested by official VSCode
plugin linting.

---------

Co-authored-by: Asher Gomez <ashersaupingomez@gmail.com>
This commit is contained in:
duffn
2023-06-05 15:01:53 +10:00
committed by GitHub
co-authored by Asher Gomez
parent 76ff7114cb
commit 65e6385bc4
+2 -2
View File
@@ -33,7 +33,7 @@ then adds a custom header to the response before returning it:
import { Handlers } from "$fresh/server.ts";
export const handler: Handlers = {
async GET(req, ctx) {
async GET(_req, ctx) {
const resp = await ctx.render();
resp.headers.set("X-Custom-Header", "Hello");
return resp;
@@ -60,7 +60,7 @@ response:
import { Handlers } from "$fresh/server.ts";
export const handler: Handlers = {
GET(req) {
GET(_req) {
const uuid = crypto.randomUUID();
return new Response(JSON.stringify(uuid), {
headers: { "Content-Type": "application/json" },