mirror of
https://github.com/ankitects/anki.git
synced 2025-09-19 06:22:22 -04:00
Support creating a standalone sync server
This commit is contained in:
parent
0f77de896d
commit
8c712cd118
4 changed files with 38 additions and 0 deletions
7
Cargo.lock
generated
7
Cargo.lock
generated
|
@ -164,6 +164,13 @@ dependencies = [
|
||||||
"zstd",
|
"zstd",
|
||||||
]
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "anki-sync-server"
|
||||||
|
version = "0.0.0"
|
||||||
|
dependencies = [
|
||||||
|
"anki",
|
||||||
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "anki_i18n"
|
name = "anki_i18n"
|
||||||
version = "0.0.0"
|
version = "0.0.0"
|
||||||
|
|
|
@ -14,6 +14,7 @@ members = [
|
||||||
"rslib/proto",
|
"rslib/proto",
|
||||||
"rslib/io",
|
"rslib/io",
|
||||||
"rslib/process",
|
"rslib/process",
|
||||||
|
"rslib/sync",
|
||||||
"pylib/rsbridge",
|
"pylib/rsbridge",
|
||||||
"build/configure",
|
"build/configure",
|
||||||
"build/ninja_gen",
|
"build/ninja_gen",
|
||||||
|
|
16
rslib/sync/Cargo.toml
Normal file
16
rslib/sync/Cargo.toml
Normal file
|
@ -0,0 +1,16 @@
|
||||||
|
[package]
|
||||||
|
name = "anki-sync-server"
|
||||||
|
version.workspace = true
|
||||||
|
authors.workspace = true
|
||||||
|
edition.workspace = true
|
||||||
|
license.workspace = true
|
||||||
|
publish = false
|
||||||
|
rust-version.workspace = true
|
||||||
|
description = "Standalone sync server"
|
||||||
|
|
||||||
|
[[bin]]
|
||||||
|
path = "main.rs"
|
||||||
|
name = "anki-sync-server"
|
||||||
|
|
||||||
|
[dependencies]
|
||||||
|
anki.workspace = true
|
14
rslib/sync/main.rs
Normal file
14
rslib/sync/main.rs
Normal file
|
@ -0,0 +1,14 @@
|
||||||
|
// Copyright: Ankitects Pty Ltd and contributors
|
||||||
|
// License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html
|
||||||
|
use std::env;
|
||||||
|
|
||||||
|
use anki::log::set_global_logger;
|
||||||
|
use anki::sync::http_server::SimpleServer;
|
||||||
|
|
||||||
|
fn main() {
|
||||||
|
if env::var("RUST_LOG").is_err() {
|
||||||
|
env::set_var("RUST_LOG", "anki=info")
|
||||||
|
}
|
||||||
|
set_global_logger(None).unwrap();
|
||||||
|
println!("{}", SimpleServer::run());
|
||||||
|
}
|
Loading…
Reference in a new issue