From 673831b0bb917841538aa1d3ab2ff38d1cc797f9 Mon Sep 17 00:00:00 2001 From: myyrakle Date: Mon, 30 Sep 2024 23:36:39 +0900 Subject: [PATCH 1/3] =?UTF-8?q?[#149]=20application.properties=20=EA=B8=B0?= =?UTF-8?q?=EB=B3=B8=20=EC=84=A4=EB=AA=85=20=EC=9E=91=EC=84=B1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- rupring/src/application_properties.rs | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/rupring/src/application_properties.rs b/rupring/src/application_properties.rs index 7996008..08b8eb5 100644 --- a/rupring/src/application_properties.rs +++ b/rupring/src/application_properties.rs @@ -1,3 +1,16 @@ +/*! +## Intro +- application.properties is a configuration method influenced by spring. + +## How to find it +- The rupring program searches the current execution path to see if there is a file called application.properties. +- If it does not exist, application.properties is searched based on the directory of the current executable file. +- If it is still not there, load it with default values ​​and start. + +## Format +- Similar to spring, it has a Key=Value format separated by newlines. +*/ + use std::collections::HashMap; #[derive(Debug, PartialEq, Clone)] From b9380ee3ea623b132cdfc833e09ab8e261cccd77 Mon Sep 17 00:00:00 2001 From: myyrakle Date: Mon, 30 Sep 2024 23:40:16 +0900 Subject: [PATCH 2/3] =?UTF-8?q?[#149]=20doc=20home=EC=97=90=20application.?= =?UTF-8?q?properties=20=EB=A7=81=ED=81=AC=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- rupring/src/lib.rs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/rupring/src/lib.rs b/rupring/src/lib.rs index e515e69..0ecdf52 100644 --- a/rupring/src/lib.rs +++ b/rupring/src/lib.rs @@ -596,6 +596,10 @@ pub fn get_user(request: rupring::Request, _: rupring::Response) -> rupring::Res return rupring::Response::new().text("OK".to_string()); } ``` + +# Application Properties +- rupring provides various execution options through a special configuration file called application.properties. +- Please refer to the corresponding [document](crate::application_properties) for more details. */ pub(crate) mod core; From a23213de5474645e7aa1e65621195a96efb76b8a Mon Sep 17 00:00:00 2001 From: myyrakle Date: Mon, 30 Sep 2024 23:43:28 +0900 Subject: [PATCH 3/3] =?UTF-8?q?[#149]=20application.properties=20=ED=8A=B9?= =?UTF-8?q?=EC=88=98=20=EC=98=B5=EC=85=98=20=EB=AC=B8=EC=84=9C=ED=99=94?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- rupring/src/application_properties.rs | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/rupring/src/application_properties.rs b/rupring/src/application_properties.rs index 08b8eb5..2d631b8 100644 --- a/rupring/src/application_properties.rs +++ b/rupring/src/application_properties.rs @@ -9,6 +9,17 @@ ## Format - Similar to spring, it has a Key=Value format separated by newlines. + +## Special Options +| Key | Description | Default | +| --- | --- | --- | +| environment | The environment to run in. | dev | +| server.port | The port to listen on. | 3000 | +| server.address | The address to listen on. | 0.0.0.0 | +| server.compression.enabled | Whether to enable compression. | false | +| server.compression.mime-types | The mime types to compress. | text/html,text/xml,text/plain,text/css,text/javascript,application/javascript,application/json,application/xml | +| server.compression.min-response-size | The minimum response size to compress. (byte) | 2048 | +| server.compression.algorithm | The compression algorithm to use. | gzip | */ use std::collections::HashMap;