remove_directory

View as MarkdownOpen in Claude

Remove a directory from being served. A leading / is added to the route automatically if missing. If the route is not currently mounted, this method does nothing.

Parameters

route
strRequired

URL path to remove (e.g., "/audio").

Returns

None

Example

from signalwire import WebService
web = WebService(
port=8002,
directories={"/audio": "./audio_files", "/images": "./public/images"}
)
web.remove_directory("/images")
web.start() # Only /audio is served