Skip to content

Commit d5e8119

Browse files
committed
add comment settings
1 parent 2a48513 commit d5e8119

File tree

2 files changed

+43
-12
lines changed

2 files changed

+43
-12
lines changed

README.md

Lines changed: 34 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -66,26 +66,49 @@ $ curl -X DELETE http://127.0.0.1:8080/{code}/{file_name}
6666
$ curl -X GET http://127.0.0.1:8080/info/{code}/{file_name}
6767
```
6868

69-
7069
### Feature highlights
7170

72-
* Dependabot configuration
71+
*
7372

7473
### Run tests
7574

7675
```
7776
./test.sh
7877
```
79-
### Configuration
80-
81-
This project uses [config-rs](https://github.com/mehcode/config-rs) to manage configuration.
82-
#### Configure with toml files
83-
```bash
84-
settings
85-
├── base.toml # default config file
86-
78+
#### Backend settings
79+
***api/settings/base.toml***
80+
```toml
81+
# Maximum upload size in megabytes
82+
max_upload_size = 1024
83+
84+
# Default code length in the url
85+
default_code_length = 3
86+
87+
# Default expiration time in seconds
88+
default_expire_secs = 7200
89+
90+
# Server configuration section
91+
[server]
92+
# Communication protocol (e.g., "http" or "https")
93+
schema = "http"
94+
95+
# Host IP address for the server
96+
host = "127.0.0.1"
97+
98+
# Port number for the server
99+
port = 8080
100+
101+
# File system configuration section
102+
[fs]
103+
# Base directory for file system operations
104+
base_dir = "fs-tmp"
105+
106+
# Database configuration section
107+
[db]
108+
# Path to the database file
109+
path = "db-tmp"
87110
```
88-
#### Override configure with environment variables
111+
#### Override settings with environment variables
89112
```bash
90113
export PF__SERVER__PORT=8080
91114
export PF__SERVER__HOST=127.0.0.1

api/settings/base.toml

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,22 @@
1+
# Maximum upload size in megabytes
12
max_upload_size = 1024
3+
# Default code length in the url
24
default_code_length = 3
5+
# Default expiration time in seconds
36
default_expire_secs = 7200
47

58
[server]
9+
# Communication protocol (e.g., "http" or "https")
610
schema = "http"
11+
# Host IP address for the server
712
host = "127.0.0.1"
13+
# Port number for the server
814
port = 8080
915

1016
[fs]
17+
# Base directory for file system operations
1118
base_dir = "fs-tmp"
1219

1320
[db]
14-
path = "db-tmp"
21+
# Path to the database file
22+
path = "db-tmp"

0 commit comments

Comments
 (0)