diff options
author | 2021-10-25 17:05:10 -0700 | |
---|---|---|
committer | 2021-10-25 17:05:10 -0700 | |
commit | 0592515639cc779eeef9781ddc50a93e5985f93c (patch) | |
tree | 0d8886aa2cf2431984507176523afbd9bcf5ce68 | |
parent | a6c4bba6c28f49f76b294760aaeeec6a7b0833c1 (diff) | |
download | bun-0592515639cc779eeef9781ddc50a93e5985f93c.tar.gz bun-0592515639cc779eeef9781ddc50a93e5985f93c.tar.zst bun-0592515639cc779eeef9781ddc50a93e5985f93c.zip |
[HTTP Server] Add flag for disabling Bun.js
-rw-r--r-- | src/http.zig | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/src/http.zig b/src/http.zig index e1fb5a4d4..d6de0a913 100644 --- a/src/http.zig +++ b/src/http.zig @@ -2944,7 +2944,7 @@ pub const Server = struct { } pub var global_start_time: std.time.Timer = undefined; - pub fn start(allocator: *std.mem.Allocator, options: Api.TransformOptions) !void { + pub fn start(allocator: *std.mem.Allocator, options: Api.TransformOptions, comptime DebugType: type, debug: DebugType) !void { var log = logger.Log.init(allocator); var server = try allocator.create(Server); server.* = Server{ @@ -2961,6 +2961,15 @@ pub const Server = struct { server.bundler.configureLinker(); try server.bundler.configureRouter(true); + if (debug.dump_environment_variables) { + server.bundler.dumpEnvironmentVariables(); + return; + } + + if (debug.fallback_only) { + RequestContext.JavaScriptHandler.javascript_disabled = true; + } + Analytics.Features.filesystem_router = server.bundler.router != null; const public_folder_is_top_level = server.bundler.options.routes.static_dir_enabled and strings.eql( |