bxo 0.0.5-dev.72 → 0.0.5-dev.73

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/example/index.ts CHANGED
@@ -3,7 +3,7 @@ import index from "./index.html";
3
3
  import { openapi } from "../plugins/openapi";
4
4
 
5
5
  async function main() {
6
- const bxo = new BXO();
6
+ const bxo = new BXO({ serve: { port: 0 } });
7
7
 
8
8
  bxo.default("/", index);
9
9
  bxo.default("/*", index);
@@ -136,8 +136,8 @@ async function main() {
136
136
 
137
137
  // Health check route
138
138
  bxo.get("/health", (ctx) => {
139
- return ctx.json({
140
- status: "ok",
139
+ return ctx.json({
140
+ status: "ok",
141
141
  timestamp: new Date().toISOString(),
142
142
  uptime: process.uptime()
143
143
  });
package/package.json CHANGED
@@ -5,7 +5,7 @@
5
5
  ".": "./src/index.ts",
6
6
  "./plugins": "./plugins/index.ts"
7
7
  },
8
- "version": "0.0.5-dev.72",
8
+ "version": "0.0.5-dev.73",
9
9
  "type": "module",
10
10
  "devDependencies": {
11
11
  "@types/bun": "latest"
package/src/index.ts CHANGED
@@ -272,12 +272,13 @@ export default class BXO {
272
272
  }
273
273
  }
274
274
 
275
+ this.serveOptions.port = this.serveOptions.port === undefined ? 3000 : this.serveOptions.port;
276
+
275
277
  this.server = Bun.serve({
276
278
  ...this.serveOptions,
277
279
  routes: nativeRoutes as any,
278
280
  fetch: (req: Request) => this.dispatchAny(req, nativeRoutes)
279
281
  });
280
- const port = (this.server as any).port ?? this.serveOptions.port ?? 3000;
281
282
  }
282
283
 
283
284
  // Lifecycle hook methods