We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent a13c453 commit eec8800Copy full SHA for eec8800
ext/http/00_serve.ts
@@ -793,9 +793,9 @@ internals.serveHttpOnConnection = serveHttpOnConnection;
793
794
function registerDeclarativeServer(exports) {
795
if (ObjectHasOwn(exports, "fetch")) {
796
- if (typeof exports.fetch !== "function" || exports.fetch.length !== 1) {
+ if (typeof exports.fetch !== "function") {
797
throw new TypeError(
798
- "Invalid type for fetch: must be a function with a single parameter",
+ "Invalid type for fetch: must be a function with a single or no parameter",
799
);
800
}
801
return ({ servePort, serveHost }) => {
tests/testdata/serve/no_args.ts
@@ -0,0 +1,5 @@
1
+export default {
2
+ fetch() {
3
+ return new Response("deno serve with no args in fetch() works!");
4
+ },
5
+};
0 commit comments