aboutsummaryrefslogtreecommitdiff
path: root/examples
diff options
context:
space:
mode:
Diffstat (limited to 'examples')
-rw-r--r--examples/http-file-extended.ts2
-rw-r--r--examples/lambda.ts3
-rw-r--r--examples/react-file-system-router/index.tsx2
-rw-r--r--examples/ssl.ts3
4 files changed, 7 insertions, 3 deletions
diff --git a/examples/http-file-extended.ts b/examples/http-file-extended.ts
index 7ae515f14..14886af5e 100644
--- a/examples/http-file-extended.ts
+++ b/examples/http-file-extended.ts
@@ -29,7 +29,7 @@ serve({
if (req.headers.has("range")) {
opts.code = 206;
- let [x, y] = req.headers.get("range").replace("bytes=", "").split("-");
+ let [x, y] = req.headers.get("range")!.replace("bytes=", "").split("-");
let end = (opts.end = parseInt(y, 10) || stats.size - 1);
let start = (opts.start = parseInt(x, 10) || 0);
diff --git a/examples/lambda.ts b/examples/lambda.ts
index 66746ecad..ec4817817 100644
--- a/examples/lambda.ts
+++ b/examples/lambda.ts
@@ -9,6 +9,9 @@ const sourceDir = LAMBDA_TASK_ROOT;
if (!sourceDir) {
throw new Error("handler is not set");
}
+if (!_HANDLER) {
+ throw new Error("handler is not set");
+}
// don't care if this fails
if (process.cwd() !== sourceDir) {
diff --git a/examples/react-file-system-router/index.tsx b/examples/react-file-system-router/index.tsx
index 62d1151d5..2abcc6b7e 100644
--- a/examples/react-file-system-router/index.tsx
+++ b/examples/react-file-system-router/index.tsx
@@ -14,7 +14,7 @@ export default {
const route = router.match(request);
- const { default: Root } = await import(route.filePath);
+ const { default: Root } = await import(route.filePath!);
return new Response(await renderToReadableStream(<Root {...route.params} />));
},
};
diff --git a/examples/ssl.ts b/examples/ssl.ts
index df30a0bd6..b886649e8 100644
--- a/examples/ssl.ts
+++ b/examples/ssl.ts
@@ -1,4 +1,5 @@
import { resolve } from "path";
+import type { ServeOptions } from "bun";
const development = process.env.NODE_ENV !== "production";
export default {
@@ -11,4 +12,4 @@ export default {
keyFile: process.env.SSL_KEY_FILE || "./key.pem",
certFile: process.env.SSL_CERTIFICATE_FILE || "./cert.pem",
development,
-} as Bun.Serve;
+} as ServeOptions;