aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorFuwn <[email protected]>2022-03-09 01:43:56 +0000
committerFuwn <[email protected]>2022-03-09 01:43:56 +0000
commit1c36d57c3380fa73ce8870e2e3a89059388b2495 (patch)
treeaa7d7f65f2ff73eead404f345e7c4bc72b7c163f /src
parentrefactor(utils): String to char (diff)
downloadapi-worker-1c36d57c3380fa73ce8870e2e3a89059388b2495.tar.xz
api-worker-1c36d57c3380fa73ce8870e2e3a89059388b2495.zip
refactor(routes): get index from file
Diffstat (limited to 'src')
-rw-r--r--src/index.rst35
-rw-r--r--src/routes.rs42
2 files changed, 36 insertions, 41 deletions
diff --git a/src/index.rst b/src/index.rst
new file mode 100644
index 0000000..0b96cf1
--- /dev/null
+++ b/src/index.rst
@@ -0,0 +1,35 @@
+api.senpy.club
+==============
+
+Routes
+------
+
+If a language requires a parameter, it will be notated like ":this".
+
+For example; if a route is notated as "/v2/route/:parameter", you can access that route via the URL "https://api.senpy.club/v2/route/parameter-value".
+
+- /
+ - /: Index page, a mirror of /v2 (you are here)
+
+- /v2
+ - /github: GitHub API mirror for https://github.com/cat-milk/Anime-Girls-Holding-Programming-Books
+ - /languages: A list of all languages that appear in the https://github.com/cat-milk/Anime-Girls-Holding-Programming-Books repository
+ - /language/:language: A list of all images that are labeled under the language, ":language", in the https://github.com/cat-milk/Anime-Girls-Holding-Programming-Books repository
+
+Notes
+-----
+
+Contributing
+^^^^^^^^^^^^
+
+If you'd like to support the project in any way, check out the repository: https://github.com/senpy-club/api-worker
+
+Supporting
+^^^^^^^^^^
+
+If you would like to support my development ventures, visit my GitHub profile: https://github.com/Fuwn
+
+License
+^^^^^^^
+
+`GNU General Public License v3.0 <https://github.com/senpy-club/api-worker/blob/main/LICENSE>`_
diff --git a/src/routes.rs b/src/routes.rs
index 7418987..2bade5d 100644
--- a/src/routes.rs
+++ b/src/routes.rs
@@ -25,47 +25,7 @@ use crate::{
};
pub fn index() -> Result<Response> {
- Response::ok(
- r#"senpy-club/api-worker
-=====================
-
-routes
-------
-if a language requires a parameter, it will be notated like ":this". for
-example; if a route is notated as "/v1/route/:parameter", you can access that
-route via the url "http://this.domain/v1/route/something".
-
-- /
- - /: index page (you are here)
-
-- /v2
- - /github: github api mirror
- - /languages: a list of all languages that appear in _the_ repository
- - /language/:language: get a list of all images that pertain to the language
- ":language"
-
-notes
------
-
-contributing
-^^^^^^^^^^^^
-
-if you'd like to support the project in any way, check out the repository!
-<https://github.com/senpy-club/api-worker>
-
-supporting
-^^^^^^^^^^
-
-if you would like to support my development ventures, visit my github profile
-`here <https://github.com/fuwn>`_.
-
-license
-^^^^^^^
-
-`gnu general public license v3.0 (:code:`gpl-3.0-only`)
-<https://github.com/senpy-club/api-worker/blob/main/LICENSE>`_"#,
- )?
- .with_cors(&cors())
+ Response::ok(include_str!("index.rst"))?.with_cors(&cors())
}
pub async fn github() -> Result<Response> {