aboutsummaryrefslogtreecommitdiff
path: root/examples/my_cool_server.ts
diff options
context:
space:
mode:
Diffstat (limited to 'examples/my_cool_server.ts')
-rw-r--r--examples/my_cool_server.ts8
1 files changed, 4 insertions, 4 deletions
diff --git a/examples/my_cool_server.ts b/examples/my_cool_server.ts
index 76657a0..793e01f 100644
--- a/examples/my_cool_server.ts
+++ b/examples/my_cool_server.ts
@@ -16,7 +16,7 @@
// Copyright (C) 2022-2022 Fuwn <[email protected]>
// SPDX-License-Identifier: GPL-3.0-only
-import { callback, route, Server } from "../mod.ts";
+import { hook, route, Server } from "../mod.ts";
import * as optic from "https://deno.land/x/[email protected]/mod.ts";
/** Implement a new Laurali server */
@@ -50,7 +50,7 @@ class MyCoolServer extends Server {
return MyCoolServer.clicks;
}
- @callback()
+ @hook()
override onPreRoute(ctx: Deno.TlsConn) {
MyCoolServer.clicks += 1;
@@ -60,12 +60,12 @@ class MyCoolServer extends Server {
);
}
- @callback()
+ @hook()
override onPostRoute() {
MyCoolServer.logger.info("Closed connection.");
}
- @callback()
+ @hook()
override onError() {
return "hi";
}