mirror of
https://github.com/mCaptcha/mCaptcha.git
synced 2026-02-12 10:35:39 +00:00
Deploying to gh-pages from @ 595e79a014 🚀
This commit is contained in:
@@ -133,21 +133,21 @@
|
||||
<span id="131">131</span>
|
||||
</pre><pre class="rust">
|
||||
<span class="comment">/*
|
||||
* Copyright (C) 2021 Aravinth Manivannan <realaravinth@batsense.net>
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Affero General Public License as
|
||||
* published by the Free Software Foundation, either version 3 of the
|
||||
* License, or (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU Affero General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Affero General Public License
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/</span>
|
||||
* Copyright (C) 2021 Aravinth Manivannan <realaravinth@batsense.net>
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Affero General Public License as
|
||||
* published by the Free Software Foundation, either version 3 of the
|
||||
* License, or (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU Affero General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Affero General Public License
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/</span>
|
||||
<span class="kw">use</span> <span class="ident">std::borrow::Cow</span>;
|
||||
|
||||
<span class="kw">use</span> <span class="ident">actix_web::body::Body</span>;
|
||||
@@ -178,10 +178,7 @@
|
||||
}
|
||||
|
||||
<span class="kw">pub</span> <span class="kw">fn</span> <span class="ident">services</span>(<span class="ident">cfg</span>: <span class="kw-2">&</span><span class="kw-2">mut</span> <span class="ident">web::ServiceConfig</span>) {
|
||||
<span class="kw">use</span> <span class="kw">crate</span><span class="ident">::define_resource</span>;
|
||||
<span class="macro">define_resource!</span>(<span class="ident">cfg</span>, <span class="kw-2">&</span><span class="ident">DOCS</span>.<span class="ident">home</span>[<span class="number">0</span>..<span class="ident">DOCS</span>.<span class="ident">home</span>.<span class="ident">len</span>() <span class="op">-</span> <span class="number">1</span>], <span class="ident">Methods::Get</span>, <span class="ident">index</span>);
|
||||
<span class="macro">define_resource!</span>(<span class="ident">cfg</span>, <span class="ident">DOCS</span>.<span class="ident">spec</span>, <span class="ident">Methods::Get</span>, <span class="ident">spec</span>);
|
||||
<span class="macro">define_resource!</span>(<span class="ident">cfg</span>, <span class="ident">DOCS</span>.<span class="ident">assets</span>, <span class="ident">Methods::Get</span>, <span class="ident">dist</span>);
|
||||
<span class="ident">cfg</span>.<span class="ident">service</span>(<span class="ident">index</span>).<span class="ident">service</span>(<span class="ident">spec</span>).<span class="ident">service</span>(<span class="ident">dist</span>);
|
||||
}
|
||||
|
||||
<span class="attribute">#[<span class="ident">derive</span>(<span class="ident">RustEmbed</span>)]</span>
|
||||
@@ -206,16 +203,19 @@
|
||||
}
|
||||
}
|
||||
|
||||
<span class="attribute">#[<span class="ident">my_codegen::get</span>(<span class="ident">path</span> <span class="op">=</span> <span class="string">"DOCS.assets"</span>)]</span>
|
||||
<span class="kw">async</span> <span class="kw">fn</span> <span class="ident">dist</span>(<span class="ident">path</span>: <span class="ident">web::Path</span><span class="op"><</span><span class="ident">String</span><span class="op">></span>) <span class="op">-</span><span class="op">></span> <span class="kw">impl</span> <span class="ident">Responder</span> {
|
||||
<span class="ident">handle_embedded_file</span>(<span class="kw-2">&</span><span class="ident">path</span>)
|
||||
}
|
||||
|
||||
<span class="attribute">#[<span class="ident">my_codegen::get</span>(<span class="ident">path</span> <span class="op">=</span> <span class="string">"DOCS.spec"</span>)]</span>
|
||||
<span class="kw">async</span> <span class="kw">fn</span> <span class="ident">spec</span>() <span class="op">-</span><span class="op">></span> <span class="ident">HttpResponse</span> {
|
||||
<span class="ident">HttpResponse::Ok</span>()
|
||||
.<span class="ident">content_type</span>(<span class="string">"appilcation/json"</span>)
|
||||
.<span class="ident">body</span>(<span class="kw-2">&</span><span class="kw-2">*</span><span class="kw">crate</span><span class="ident">::OPEN_API_DOC</span>)
|
||||
}
|
||||
|
||||
<span class="attribute">#[<span class="ident">my_codegen::get</span>(<span class="ident">path</span> <span class="op">=</span> <span class="string">"&DOCS.home[0..DOCS.home.len() -1]"</span>)]</span>
|
||||
<span class="kw">async</span> <span class="kw">fn</span> <span class="ident">index</span>() <span class="op">-</span><span class="op">></span> <span class="ident">HttpResponse</span> {
|
||||
<span class="ident">handle_embedded_file</span>(<span class="string">"index.html"</span>)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user