Add browsing support to the pdocs utility.

This commit is contained in:
Relintai 2024-05-04 16:16:38 +02:00
parent 177e63e383
commit 2a414ea2ea
2 changed files with 8 additions and 7 deletions

View File

@ -1,11 +1,11 @@
extends WebRoot
extends BrowsableFolderServeWebPage
var markdown_renderer : MarkdownRenderer = null
func serve_md(request: WebServerRequest) -> void:
var path : String = request.get_path_full()
var fabs : String = www_root_file_cache.wwwroot_get_file_abspath(path)
var fabs : String = get_file_cache().wwwroot_get_file_abspath(path)
if fabs == "":
request.send_error(HTTPServerEnums.HTTP_STATUS_CODE_404_NOT_FOUND)

View File

@ -1,6 +1,6 @@
[gd_scene load_steps=2 format=3]
[ext_resource path="res://WebRoot.gd" type="Script" id=1]
[ext_resource path="res://BrowsableFolderServeWebPage.gd" type="Script" id=1]
[node name="Main" type="Node"]
@ -25,6 +25,7 @@ uri = "http://127.0.0.1:8080"
[node name="WebServerSimple" type="WebServerSimple" parent="."]
start_on_ready = true
[node name="WebRoot" type="WebRoot" parent="WebServerSimple"]
www_root_path = "res://www/"
[node name="BrowsableFolderServeWebPage" type="BrowsableFolderServeWebPage" parent="WebServerSimple"]
uri_segment = "/"
serve_folder = "res://www/"
script = ExtResource( 1 )