]> Lady’s Gitweb - Vocab/blob - scripts/serve.rb
Make pcdm:File a siocactions:DigitalArtifact
[Vocab] / scripts / serve.rb
1 #!/usr/bin/ruby
2 # SPDX-FileCopyrightText: 2025 Lady <https://www.ladys.computer/about/#lady>
3 # SPDX-License-Identifier: CC0-1.0
4
5 require "webrick"
6
7 server = WEBrick::HTTPServer.new(Port: ARGV[0] || 3000, DocumentRoot: "public", DirectoryIndex: ["index.xhtml"])
8 trap 'INT' do server.shutdown end
9
10 class XHTMLHandler < WEBrick::HTTPServlet::DefaultFileHandler
11 def do_GET request, response
12 super
13 response['Content-Type'] = 'application/xhtml+xml'
14 end
15 end
16 WEBrick::HTTPServlet::FileHandler.add_handler("xhtml", XHTMLHandler)
17
18 server.start
This page took 0.057188 seconds and 5 git commands to generate.