refactored logic from templates to rust, and added cli network config

This commit is contained in:
2026-02-19 14:31:54 +01:00
parent 18e695eebe
commit 429a5cc051
6 changed files with 122 additions and 104 deletions
+3 -9
View File
@@ -2,14 +2,6 @@
A lightweight application for generating dynamic form websites and storing user responses. The form fields, labels, and behavior are fully configurable via a TOML configuration file.
## Usage
The server will listen on `127.0.0.1:8081` by default. You can override with:
```bash
SERVER_PORT=8082 form-generator
```
## Configuration
The application is configured via a TOML file (default: `config.toml`).
@@ -20,13 +12,15 @@ See [config.toml](./config.toml) for an example.
* `json_output`: Path to the JSON file where responses are stored.
* `form_title`: Title of the page and form.
* `submit_button`: Text displayed on the forms submit button.
* `fields`: List of form fields
* `name`: Internal key for storage.
* `title`: Label displayed in the form.
* `description`: Short description displayed below the field.
* `answer_type`: Type of input (`text`, `number`, `email`, `password`, `url`, `tel`, `textarea`).
* `answer_type`: Type of input (`text`, `number`, `email`, `password`, `url`, `tel`, `textarea`, `select`, `checkbox`, etc).
* `html_before` (optional): HTML snippet rendered before the field.
* `html_after` (optional): HTML snippet rendered after the field.