mirror of
https://github.com/oven-sh/bun
synced 2026-02-11 03:18:53 +00:00
SSR!
Former-commit-id: bbc23b382c2eec15436fad632f5efe06e8e8360d
This commit is contained in:
@@ -5,6 +5,7 @@ const FilesystemRouter = @import("../../../router.zig");
|
||||
const http = @import("../../../http.zig");
|
||||
const JavaScript = @import("../javascript.zig");
|
||||
const QueryStringMap = @import("../../../query_string_map.zig").QueryStringMap;
|
||||
const CombinedScanner = @import("../../../query_string_map.zig").CombinedScanner;
|
||||
usingnamespace @import("../bindings/bindings.zig");
|
||||
usingnamespace @import("../webcore/response.zig");
|
||||
const Router = @This();
|
||||
@@ -327,9 +328,21 @@ pub fn getQuery(
|
||||
exception: js.ExceptionRef,
|
||||
) js.JSValueRef {
|
||||
if (this.query_string_map == null) {
|
||||
if (QueryStringMap.init(getAllocator(ctx), this.route.query_string)) |map| {
|
||||
this.query_string_map = map;
|
||||
} else |err| {}
|
||||
if (this.route.params.len > 0) {
|
||||
if (QueryStringMap.initWithScanner(getAllocator(ctx), CombinedScanner.init(
|
||||
this.route.query_string,
|
||||
this.route.pathnameWithoutLeadingSlash(),
|
||||
this.route.name,
|
||||
|
||||
this.route.params,
|
||||
))) |map| {
|
||||
this.query_string_map = map;
|
||||
} else |err| {}
|
||||
} else {
|
||||
if (QueryStringMap.init(getAllocator(ctx), this.route.query_string)) |map| {
|
||||
this.query_string_map = map;
|
||||
} else |err| {}
|
||||
}
|
||||
}
|
||||
|
||||
// If it's still null, the query string has no names.
|
||||
|
||||
@@ -126,9 +126,6 @@ pub const VirtualMachine = struct {
|
||||
vm.console,
|
||||
);
|
||||
VirtualMachine.vm_loaded = true;
|
||||
std.debug.print("VM IS LOADED {}", .{
|
||||
VirtualMachine.vm_loaded,
|
||||
});
|
||||
|
||||
return VirtualMachine.vm;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user