Files
herolib/examples/data/ourdb_server.vsh
Mahmoud Emad ae7e7ecb84 feat: Add OurDB key-value store server
- Adds a new lightweight key-value store server implemented in V.
- Includes basic CRUD operations (`set`, `get`, `delete`).
- Provides configurable host and operation restrictions for security.
- Offers middleware for logging and request validation.
- Supports incremental mode for automatic ID generation.
- Includes comprehensive documentation and example usage.
- Adds unit tests to ensure functionality and stability.
2025-03-05 23:02:35 +02:00

18 lines
421 B
GLSL
Executable File

#!/usr/bin/env -S v -n -w -gc none -cc tcc -d use_openssl -enable-globals run
import freeflowuniverse.herolib.data.ourdb
import os
mut server := ourdb.new_server(
port: 9000
allowed_hosts: ['localhost']
allowed_operations: ['set', 'get', 'delete']
secret_key: 'secret'
config: ourdb.OurDBConfig{
path: '/tmp/ourdb'
incremental_mode: true
}
)!
server.run()