feat(server): Allow for custom HEAD method implementations (#1175)
Fixes https://github.com/denoland/fresh/issues/1115 Fixes https://github.com/denoland/fresh/issues/1165 --------- Co-authored-by: Asher Gomez <ashersaupingomez@gmail.com>
This commit is contained in:
co-authored by
Asher Gomez
parent
366c8afef1
commit
e86a126c0a
@@ -0,0 +1,17 @@
|
||||
export const handler = {
|
||||
HEAD() {
|
||||
return new Response(null, {
|
||||
status: 204,
|
||||
headers: {
|
||||
"Content-Type": "text/html; charset=utf-8",
|
||||
},
|
||||
});
|
||||
},
|
||||
GET() {
|
||||
return new Response("Get fresh!", {
|
||||
headers: {
|
||||
"Content-Type": "application/json; charset=utf-8",
|
||||
},
|
||||
});
|
||||
},
|
||||
};
|
||||
Reference in New Issue
Block a user