Fix Static File Bundling

This commit is contained in:
spikecodes 2020-11-29 13:46:53 -08:00
parent 3902a36ea3
commit 8f157c0b40
4 changed files with 16581 additions and 68 deletions

107
Cargo.lock generated
View File

@ -40,9 +40,9 @@ dependencies = [
[[package]]
name = "actix-http"
version = "2.1.0"
version = "2.2.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "404df68c297f73b8d36c9c9056404913d25905a8f80127b0e5fe147c9c4b9f02"
checksum = "452299e87817ae5673910e53c243484ca38be3828db819b6011736fc6982e874"
dependencies = [
"actix-codec",
"actix-connect",
@ -80,7 +80,7 @@ dependencies = [
"regex",
"serde",
"serde_json",
"serde_urlencoded 0.6.1",
"serde_urlencoded",
"sha-1",
"slab",
"time 0.2.23",
@ -93,7 +93,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "a60f9ba7c4e6df97f3aacb14bb5c0cd7d98a49dcbaed0d7f292912ad9a6a3ed2"
dependencies = [
"quote 1.0.7",
"syn 1.0.50",
"syn 1.0.52",
]
[[package]]
@ -221,9 +221,9 @@ dependencies = [
[[package]]
name = "actix-web"
version = "3.2.0"
version = "3.3.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "88344b7a5ef27e5e09e73565379f69273dd3e2d29e82afc381b84d170d0a5631"
checksum = "7d6d0a6ae7ff7290372b3f636b9fc38b76dfbfc395187ce21e5b95471f7ccab9"
dependencies = [
"actix-codec",
"actix-http",
@ -252,7 +252,7 @@ dependencies = [
"rustls",
"serde",
"serde_json",
"serde_urlencoded 0.6.1",
"serde_urlencoded",
"socket2",
"time 0.2.23",
"tinyvec",
@ -267,7 +267,7 @@ checksum = "ad26f77093333e0e7c6ffe54ebe3582d908a104e448723eec6d43d08b07143fb"
dependencies = [
"proc-macro2 1.0.24",
"quote 1.0.7",
"syn 1.0.50",
"syn 1.0.52",
]
[[package]]
@ -438,9 +438,9 @@ dependencies = [
[[package]]
name = "async-io"
version = "1.2.0"
version = "1.3.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "40a0b2bb8ae20fede194e779150fe283f65a4a08461b496de546ec366b174ad9"
checksum = "458c8f66c246624e7cf87c01451f3392ab77d66a0f105a49d9353b30ea97ced8"
dependencies = [
"concurrent-queue",
"fastrand",
@ -506,7 +506,7 @@ checksum = "8d3a45e77e34375a7923b1e8febb049bb011f064714a8e17a1a616fef01da13d"
dependencies = [
"proc-macro2 1.0.24",
"quote 1.0.7",
"syn 1.0.50",
"syn 1.0.52",
]
[[package]]
@ -523,9 +523,9 @@ checksum = "cdb031dd78e28731d87d56cc8ffef4a8f36ca26c38fe2de700543e627f8a464a"
[[package]]
name = "awc"
version = "2.0.1"
version = "2.0.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "425980a1e58e5030a3e4b065a3d577c8f0e16142ea9d81f30614eae810c98577"
checksum = "b381e490e7b0cfc37ebc54079b0413d8093ef43d14a4e4747083f7fa47a9e691"
dependencies = [
"actix-codec",
"actix-http",
@ -543,7 +543,7 @@ dependencies = [
"rustls",
"serde",
"serde_json",
"serde_urlencoded 0.6.1",
"serde_urlencoded",
]
[[package]]
@ -764,13 +764,12 @@ dependencies = [
[[package]]
name = "crossbeam-utils"
version = "0.8.0"
version = "0.8.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "ec91540d98355f690a86367e566ecad2e9e579f230230eb7c21398372be73ea5"
checksum = "02d96d1e189ef58269ebe5b97953da3274d83a93af647c2ddd6f9dab28cedb8d"
dependencies = [
"autocfg",
"cfg-if 1.0.0",
"const_fn",
"lazy_static",
]
@ -838,7 +837,7 @@ checksum = "41cb0e6161ad61ed084a36ba71fbba9e3ac5aee3606fb607fe08da6acbcf3d8c"
dependencies = [
"proc-macro2 1.0.24",
"quote 1.0.7",
"syn 1.0.50",
"syn 1.0.52",
]
[[package]]
@ -856,12 +855,6 @@ version = "1.0.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "212d0f5754cb6769937f4501cc0e67f4f4483c8d2c3e1e922ee9edbe4ab4c7c0"
[[package]]
name = "dtoa"
version = "0.4.6"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "134951f4028bdadb9b84baf4232681efbf277da25144b9b0ad65df75946c422b"
[[package]]
name = "either"
version = "1.6.1"
@ -886,7 +879,7 @@ dependencies = [
"heck",
"proc-macro2 1.0.24",
"quote 1.0.7",
"syn 1.0.50",
"syn 1.0.52",
]
[[package]]
@ -1019,7 +1012,7 @@ dependencies = [
"proc-macro-hack",
"proc-macro2 1.0.24",
"quote 1.0.7",
"syn 1.0.50",
"syn 1.0.52",
]
[[package]]
@ -1241,7 +1234,7 @@ dependencies = [
"serde",
"serde_json",
"serde_qs",
"serde_urlencoded 0.7.0",
"serde_urlencoded",
"url",
]
@ -1401,7 +1394,7 @@ dependencies = [
[[package]]
name = "libreddit"
version = "0.1.6"
version = "0.1.7"
dependencies = [
"actix-web",
"askama",
@ -1533,9 +1526,9 @@ dependencies = [
[[package]]
name = "miow"
version = "0.2.1"
version = "0.2.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "8c1f2f3b1cf331de6896aabf6e9d55dca90356cc9960cca7eaaf408a355ae919"
checksum = "ebd808424166322d4a38da87083bfddd3ac4c131334ed55856112eb06d46944d"
dependencies = [
"kernel32-sys",
"net2",
@ -1555,9 +1548,9 @@ dependencies = [
[[package]]
name = "net2"
version = "0.2.35"
version = "0.2.36"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "3ebc3ec692ed7c9a255596c67808dee269f64655d8baf7b4f0638e51ba1d6853"
checksum = "d7cf75f38f16cb05ea017784dc6dbfd354f76c223dba37701734c4f5a9337d02"
dependencies = [
"cfg-if 0.1.10",
"libc",
@ -1704,7 +1697,7 @@ checksum = "65ad2ae56b6abe3a1ee25f15ee605bacadb9a764edaba9c2bf4103800d4a1895"
dependencies = [
"proc-macro2 1.0.24",
"quote 1.0.7",
"syn 1.0.50",
"syn 1.0.52",
]
[[package]]
@ -1715,7 +1708,7 @@ checksum = "f8e8d2bf0b23038a4424865103a4df472855692821aab4e4f5c3312d461d9e5f"
dependencies = [
"proc-macro2 1.0.24",
"quote 1.0.7",
"syn 1.0.50",
"syn 1.0.52",
]
[[package]]
@ -1757,11 +1750,11 @@ dependencies = [
[[package]]
name = "polyval"
version = "0.4.1"
version = "0.4.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "a5884790f1ce3553ad55fec37b5aaac5882e0e845a2612df744d6c85c9bf046c"
checksum = "b3fd900a291ceb8b99799cc8cd3d1d3403a51721e015bc533528b2ceafcc443c"
dependencies = [
"cfg-if 0.1.10",
"cfg-if 1.0.0",
"universal-hash",
]
@ -1914,9 +1907,9 @@ dependencies = [
[[package]]
name = "ring"
version = "0.16.17"
version = "0.16.18"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "c5911690c9b773bab7e657471afc207f3827b249a657241327e3544d79bcabdd"
checksum = "70017ed5c555d79ee3538fc63ca09c70ad8f317dcadc1adc2c496b60c22bb24f"
dependencies = [
"cc",
"libc",
@ -2019,7 +2012,7 @@ checksum = "cbd1ae72adb44aab48f325a02444a5fc079349a8d804c1fc922aed3f7454c74e"
dependencies = [
"proc-macro2 1.0.24",
"quote 1.0.7",
"syn 1.0.50",
"syn 1.0.52",
]
[[package]]
@ -2045,18 +2038,6 @@ dependencies = [
"thiserror",
]
[[package]]
name = "serde_urlencoded"
version = "0.6.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "9ec5d77e2d4c73717816afac02670d5c4f534ea95ed430442cad02e7a6e32c97"
dependencies = [
"dtoa",
"itoa",
"serde",
"url",
]
[[package]]
name = "serde_urlencoded"
version = "0.7.0"
@ -2193,7 +2174,7 @@ dependencies = [
"quote 1.0.7",
"serde",
"serde_derive",
"syn 1.0.50",
"syn 1.0.52",
]
[[package]]
@ -2209,7 +2190,7 @@ dependencies = [
"serde_derive",
"serde_json",
"sha1",
"syn 1.0.50",
"syn 1.0.52",
]
[[package]]
@ -2259,9 +2240,9 @@ dependencies = [
[[package]]
name = "syn"
version = "1.0.50"
version = "1.0.52"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "443b4178719c5a851e1bde36ce12da21d74a0e60b4d982ec3385a933c812f0f6"
checksum = "6c1e438504729046a5cfae47f97c30d6d083c7d91d94603efdae3477fc070d4c"
dependencies = [
"proc-macro2 1.0.24",
"quote 1.0.7",
@ -2285,7 +2266,7 @@ checksum = "9ba20f23e85b10754cd195504aebf6a27e2e6cbe28c17778a0c930724628dd56"
dependencies = [
"proc-macro2 1.0.24",
"quote 1.0.7",
"syn 1.0.50",
"syn 1.0.52",
]
[[package]]
@ -2352,7 +2333,7 @@ dependencies = [
"proc-macro2 1.0.24",
"quote 1.0.7",
"standback",
"syn 1.0.50",
"syn 1.0.52",
]
[[package]]
@ -2446,7 +2427,7 @@ checksum = "80e0ccfc3378da0cce270c946b676a376943f5cd16aeba64568e7939806f4ada"
dependencies = [
"proc-macro2 1.0.24",
"quote 1.0.7",
"syn 1.0.50",
"syn 1.0.52",
]
[[package]]
@ -2543,9 +2524,9 @@ dependencies = [
[[package]]
name = "unicode-segmentation"
version = "1.7.0"
version = "1.7.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "db8716a166f290ff49dabc18b44aa407cb7c6dbe1aa0971b44b8a24b0ca35aae"
checksum = "bb0d2e7be6ae3a5fa87eed5fb451aff96f2573d2694942e40543ae0bbe19c796"
[[package]]
name = "unicode-width"
@ -2657,7 +2638,7 @@ dependencies = [
"log",
"proc-macro2 1.0.24",
"quote 1.0.7",
"syn 1.0.50",
"syn 1.0.52",
"wasm-bindgen-shared",
]
@ -2691,7 +2672,7 @@ checksum = "f249f06ef7ee334cc3b8ff031bfc11ec99d00f34d86da7498396dc1e3b1498fe"
dependencies = [
"proc-macro2 1.0.24",
"quote 1.0.7",
"syn 1.0.50",
"syn 1.0.52",
"wasm-bindgen-backend",
"wasm-bindgen-shared",
]

View File

@ -3,7 +3,7 @@ name = "libreddit"
description = " Alternative private front-end to Reddit"
license = "AGPL-3.0"
repository = "https://github.com/spikecodes/libreddit"
version = "0.1.6"
version = "0.1.7"
authors = ["spikecodes <19519553+spikecodes@users.noreply.github.com>"]
edition = "2018"

16534
cargo-timing.html Normal file

File diff suppressed because it is too large Load Diff

View File

@ -12,14 +12,12 @@ mod utils;
// Create Services
#[get("/style.css")]
async fn style() -> HttpResponse {
let file = std::fs::read_to_string("static/style.css").expect("ERROR: Could not read style.css");
HttpResponse::Ok().content_type("text/css").body(file)
HttpResponse::Ok().content_type("text/css").body(include_str!("../static/style.css"))
}
#[get("/robots.txt")]
async fn robots() -> HttpResponse {
let file = std::fs::read_to_string("static/robots.txt").expect("ERROR: Could not read robots.txt");
HttpResponse::Ok().body(file)
HttpResponse::Ok().body(include_str!("../static/robots.txt"))
}
#[get("/favicon.ico")]