yedra 0.10.1 → 0.10.2
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/dist/routing/app.js +9 -1
- package/package.json +1 -1
package/dist/routing/app.js
CHANGED
|
@@ -57,7 +57,14 @@ export class App {
|
|
|
57
57
|
Bun.serve({
|
|
58
58
|
port: port,
|
|
59
59
|
fetch: async (req, server) => {
|
|
60
|
-
|
|
60
|
+
const url = new URL(req.url).pathname;
|
|
61
|
+
const begin = Date.now();
|
|
62
|
+
const response = await this.handle(req, server);
|
|
63
|
+
const duration = Date.now() - begin;
|
|
64
|
+
if (response !== undefined) {
|
|
65
|
+
console.log(`[${new Date().toISOString()}] ${req.method} ${url} -> ${response.status} (${duration}ms)`);
|
|
66
|
+
}
|
|
67
|
+
return response;
|
|
61
68
|
},
|
|
62
69
|
websocket: {
|
|
63
70
|
async open(ws) {
|
|
@@ -71,6 +78,7 @@ export class App {
|
|
|
71
78
|
},
|
|
72
79
|
},
|
|
73
80
|
});
|
|
81
|
+
console.log(`yedra listening on http://localhost:${port}...`);
|
|
74
82
|
}
|
|
75
83
|
static errorResponse(status, errorMessage) {
|
|
76
84
|
return Response.json({
|