Sha256: 1694d6349bcc411028e24628167e2fef7c59217da58a7df133c6730adea62435
Contents?: true
Size: 623 Bytes
Versions: 2
Compression:
Stored size: 623 Bytes
Contents
# frozen_string_literal: true require 'singleton' require 'forwardable' require 'rack' require 'mwc' module Mwc # Static assets server class Server WASM_RULE = /\.(?:wasm)\z/.freeze WASM_HEADER = { 'Content-Type' => 'application/wasm' }.freeze def initialize @static = Rack::Static.new( ->(_) { [404, {}, []] }, root: 'dist', # TODO: Set by config index: "#{Mwc.project.name}.html", urls: [''], header_rules: [ [WASM_RULE, WASM_HEADER] ] ) end def call(env) @static.call(env) end end end
Version data entries
2 entries across 2 versions & 1 rubygems
Version | Path |
---|---|
mwc-0.4.0 | lib/mwc/server.rb |
mwc-0.3.0 | lib/mwc/server.rb |