Set up Rocket for testing environment

This commit is contained in:
Kitaiti Makoto
2023-01-15 06:58:01 +09:00
parent 4eab51b159
commit 3dad83b179
3 changed files with 32 additions and 8 deletions
+1 -1
View File
@@ -41,7 +41,7 @@ pub enum InvalidRocketConfig {
SecretKey,
}
fn get_rocket_config() -> Result<RocketConfig, InvalidRocketConfig> {
pub fn get_rocket_config() -> Result<RocketConfig, InvalidRocketConfig> {
let mut c = RocketConfig::active().map_err(|_| InvalidRocketConfig::Env)?;
let address = var("ROCKET_ADDRESS").unwrap_or_else(|_| "localhost".to_owned());
+1 -1
View File
@@ -305,7 +305,7 @@ macro_rules! last {
}
mod config;
pub use config::{Config, CONFIG};
pub use config::{get_rocket_config, Config, SearchTokenizerConfig, CONFIG};
pub fn ap_url(url: &str) -> String {
format!("https://{}", url)