summaryrefslogtreecommitdiffstats
path: root/src/remote/server.rs
diff options
context:
space:
mode:
authorEllie Huxtable <e@elm.sh>2021-04-09 12:40:21 +0100
committerEllie Huxtable <e@elm.sh>2021-04-09 12:40:21 +0100
commit9f16f76bd8d15824e27e971245ea93271fe76b29 (patch)
tree6687ec0f743edb682dbb9f04f688fd059f404174 /src/remote/server.rs
parentb5845bc3a1e9869389414f13a6dee2acd8cb0c2c (diff)
Update config
Diffstat (limited to 'src/remote/server.rs')
-rw-r--r--src/remote/server.rs9
1 files changed, 5 insertions, 4 deletions
diff --git a/src/remote/server.rs b/src/remote/server.rs
index 4409f646..cd2ca7b8 100644
--- a/src/remote/server.rs
+++ b/src/remote/server.rs
@@ -16,25 +16,26 @@ use super::auth::*;
embed_migrations!("migrations");
-pub fn launch(settings: &Settings) {
+pub fn launch(settings: &Settings, host: String, port: u16) {
let mut database_config = HashMap::new();
let mut databases = HashMap::new();
- database_config.insert("url", Value::from(settings.remote.db.url.clone()));
+ database_config.insert("url", Value::from(settings.remote.db_uri.clone()));
databases.insert("atuin", Value::from(database_config));
let connection = establish_connection(settings);
embedded_migrations::run(&connection).expect("failed to run migrations");
let config = Config::build(Environment::Production)
- .address("0.0.0.0")
+ .address(host)
.log_level(LoggingLevel::Normal)
- .port(8080)
+ .port(port)
.extra("databases", databases)
.finalize()
.unwrap();
let app = rocket::custom(config);
+
app.mount("/", routes![index, register, add_history, login])
.attach(AtuinDbConn::fairing())
.register(catchers![internal_error, bad_request])