| Crates.io | parser-web |
| lib.rs | parser-web |
| version | 0.1.3 |
| created_at | 2025-03-21 03:22:28.617076+00 |
| updated_at | 2025-03-21 03:22:28.617076+00 |
| description | Web API for extracting text from various file formats |
| homepage | |
| repository | https://github.com/excoffierleonard/parser |
| max_upload_size | |
| id | 1600054 |
| size | 104,090 |
REST API and web interface for the parser-core library, enabling document parsing through HTTP requests.
# Build from source
cargo build -p parser-web
# Run with default settings
cargo run -p parser-web
Environment variables:
PARSER_APP_PORT: API server port (default: 8080)ENABLE_FILE_SERVING: Enable static file serving (default: false)RUST_LOG: Logging level (default: info)POST /parse
Multipart form with one or more files using the key file.
{
"texts": [
"Parsed text of first document.",
"Parsed text of second document."
]
}
200 OK: Successfully parsed documents400 Bad Request: Invalid request format500 Internal Server Error: Parsing failed# Upload and parse a single file
curl -X POST \
-F "file=@document.pdf" \
http://localhost:8080/parse
# Upload and parse multiple files
curl -X POST \
-F "file=@document1.pdf" \
-F "file=@document2.docx" \
http://localhost:8080/parse
When ENABLE_FILE_SERVING=true, the server provides a simple web interface at the root URL for testing the API.