REST API
DearDiary.APIConfig — Type
APIConfigA struct to hold the configuration for the API server.
Fields
host::String: The host of the API server.port::UInt16: The port of the API server.db_file::String: The path to the SQLite database file.jwt_secret::String: The JWT secret for authentication.enable_auth::Bool: Whether to enable authentication or not.cors_origins::Vector{String}: Browser origins allowed to call the API. Use["*"]to allow any origin (default in development).artifact_backend::String: WhichAbstractArtifactStorebackend handlesResourcebytes. One of"sqlite"(default, legacy inline storage),"filesystem", or"s3". Selected at server startup by theDEARDIARY_ARTIFACT_BACKENDenv var.artifact_fs_root::String: Root directory for theFilesystemStorebackend. Honoured only whenartifact_backend == "filesystem". Created on first write.artifact_s3_bucket::String: Bucket name for theS3Storebackend.artifact_s3_endpoint::String: Scheme + host for S3 requests (e.g.https://s3.us-east-1.amazonaws.com,http://localhost:9000for MinIO).artifact_s3_region::String: Region used in the SigV4 credential scope.artifact_s3_access_key::String,artifact_s3_secret_key::String: SigV4 credentials.enable_ui::Bool: Settrueto makeDearDiary.runboot the embedded Bonito dashboard onui_host:ui_portalongside the REST API server. Defaults totrue.ui_host::String: Host the dashboard binds to. Defaults to127.0.0.1.ui_port::UInt16: Port the dashboard binds to. Defaults to9001.
DearDiary.run — Function
run(; env_file::String=".env")Starts the server.
By default, the server will run on 127.0.0.1:9000. You can change both the host and port by modifying the .env file specific entries. The environment variables are loaded from the .env file by default. You can change the file path by passing the env_file argument.
DearDiary.stop — Function
stop()Stops the server. Alias for Oxygen.Core.terminate().