You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/docs/configuration/http.mdx
+1-9Lines changed: 1 addition & 9 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -2,10 +2,6 @@
2
2
3
3
dir-browser provides a lightweight HTTP API that allows you to retrieve directory listings and file metadata in JSON format. These endpoints are useful for building custom frontends or integrating with other services.
4
4
5
-
:::info
6
-
The `?ls` and `?info` endpoints require the `API` environment variable to be set to `true`.
7
-
:::
8
-
9
5
## Folder Listing (`?ls`)
10
6
11
7
To retrieve the contents of a directory as a JSON array, append `?ls` to any folder URL.
@@ -43,8 +39,6 @@ To retrieve the contents of a directory as a JSON array, append `?ls` to any fol
To retrieve detailed metadata for a specific file, append `?info` to the file URL.
@@ -65,8 +59,6 @@ To retrieve detailed metadata for a specific file, append `?info` to the file UR
65
59
}
66
60
```
67
61
68
-

69
-
70
62
## File Preview (`?preview`)
71
63
72
64
The `?preview` endpoint returns file metadata along with a content snippet for supported text-based files. This endpoint is used by the built-in popup previewer and **does not increment the download counter**.
@@ -102,7 +94,7 @@ The `?raw` endpoint serves the file's raw content directly. Similar to `?preview
102
94
103
95
## Configuration
104
96
105
-
The API endpoints can be enabled or disabled using the `API` environment variable. Disabling the API will also disable features that depend on it, such as the file previewer.
97
+
The API endpoints can be enabled or disabled using the `API` environment variable. The `?ls` and `?info` endpoints require the `API` environment variable to be set to `true`.
0 commit comments