├── .circleci └── config.yml ├── .dockerignore ├── .gitignore ├── Cargo.lock ├── Cargo.toml ├── Dockerfile ├── LICENSE ├── README.md ├── src ├── api.rs ├── config.rs ├── lib.rs └── main.rs ├── tests └── integration.rs └── tools ├── pre-commit └── pre-push /.circleci/config.yml: -------------------------------------------------------------------------------- 1 | version: 2.1 2 | 3 | workflows: 4 | test-and-build: 5 | jobs: 6 | - test 7 | - build 8 | 9 | jobs: 10 | test: 11 | docker: 12 | - image: rust:1.59.0 13 | working_directory: /app 14 | steps: 15 | - run: 16 | name: Install dependencies 17 | command: | 18 | rustup component add rustfmt clippy 19 | - checkout 20 | - restore_cache: 21 | keys: 22 | - test-v1-{{ checksum "Cargo.lock" }}- 23 | - test-v1- 24 | - run: 25 | name: Check formatting 26 | command: | 27 | cargo fmt -- --check --verbose 28 | - run: 29 | name: Clippy 30 | command: | 31 | cargo clippy --all-targets 32 | - run: 33 | name: Test 34 | command: | 35 | cargo test 36 | - save_cache: 37 | paths: 38 | - target 39 | - /usr/local/cargo/registry 40 | key: test-v1-{{ checksum "Cargo.lock" }}-{{ epoch }} 41 | 42 | build: 43 | docker: 44 | - image: clux/muslrust:1.50.0-stable 45 | working_directory: /app 46 | steps: 47 | - checkout 48 | - restore_cache: 49 | keys: 50 | - build-v1-{{ checksum "Cargo.lock" }}- 51 | - build-v1- 52 | - run: 53 | name: Build 54 | command: | 55 | cargo build --release 56 | - save_cache: 57 | paths: 58 | - target 59 | - ~/.cargo/registry 60 | key: build-v1-{{ checksum "Cargo.lock" }}-{{ epoch }} 61 | - store_artifacts: 62 | path: target/x86_64-unknown-linux-musl/release/rust-web-boilerplate 63 | -------------------------------------------------------------------------------- /.dockerignore: -------------------------------------------------------------------------------- 1 | /target 2 | **/*.rs.bk -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | /target 2 | **/*.rs.bk -------------------------------------------------------------------------------- /Cargo.lock: -------------------------------------------------------------------------------- 1 | # This file is automatically @generated by Cargo. 2 | # It is not intended for manual editing. 3 | version = 3 4 | 5 | [[package]] 6 | name = "aead" 7 | version = "0.3.2" 8 | source = "registry+https://github.com/rust-lang/crates.io-index" 9 | checksum = "7fc95d1bdb8e6666b2b217308eeeb09f2d6728d104be3e31916cc74d15420331" 10 | dependencies = [ 11 | "generic-array", 12 | ] 13 | 14 | [[package]] 15 | name = "aes" 16 | version = "0.6.0" 17 | source = "registry+https://github.com/rust-lang/crates.io-index" 18 | checksum = "884391ef1066acaa41e766ba8f596341b96e93ce34f9a43e7d24bf0a0eaf0561" 19 | dependencies = [ 20 | "aes-soft", 21 | "aesni", 22 | "cipher", 23 | ] 24 | 25 | [[package]] 26 | name = "aes-gcm" 27 | version = "0.8.0" 28 | source = "registry+https://github.com/rust-lang/crates.io-index" 29 | checksum = "5278b5fabbb9bd46e24aa69b2fdea62c99088e0a950a9be40e3e0101298f88da" 30 | dependencies = [ 31 | "aead", 32 | "aes", 33 | "cipher", 34 | "ctr", 35 | "ghash", 36 | "subtle", 37 | ] 38 | 39 | [[package]] 40 | name = "aes-soft" 41 | version = "0.6.4" 42 | source = "registry+https://github.com/rust-lang/crates.io-index" 43 | checksum = "be14c7498ea50828a38d0e24a765ed2effe92a705885b57d029cd67d45744072" 44 | dependencies = [ 45 | "cipher", 46 | "opaque-debug", 47 | ] 48 | 49 | [[package]] 50 | name = "aesni" 51 | version = "0.10.0" 52 | source = "registry+https://github.com/rust-lang/crates.io-index" 53 | checksum = "ea2e11f5e94c2f7d386164cc2aa1f97823fed6f259e486940a71c174dd01b0ce" 54 | dependencies = [ 55 | "cipher", 56 | "opaque-debug", 57 | ] 58 | 59 | [[package]] 60 | name = "ansi_term" 61 | version = "0.12.1" 62 | source = "registry+https://github.com/rust-lang/crates.io-index" 63 | checksum = "d52a9bb7ec0cf484c551830a7ce27bd20d67eac647e1befb56b0be4ee39a55d2" 64 | dependencies = [ 65 | "winapi", 66 | ] 67 | 68 | [[package]] 69 | name = "anyhow" 70 | version = "1.0.55" 71 | source = "registry+https://github.com/rust-lang/crates.io-index" 72 | checksum = "159bb86af3a200e19a068f4224eae4c8bb2d0fa054c7e5d1cacd5cef95e684cd" 73 | 74 | [[package]] 75 | name = "arrayref" 76 | version = "0.3.6" 77 | source = "registry+https://github.com/rust-lang/crates.io-index" 78 | checksum = "a4c527152e37cf757a3f78aae5a06fbeefdb07ccc535c980a3208ee3060dd544" 79 | 80 | [[package]] 81 | name = "arrayvec" 82 | version = "0.5.2" 83 | source = "registry+https://github.com/rust-lang/crates.io-index" 84 | checksum = "23b62fc65de8e4e7f52534fb52b0f3ed04746ae267519eef2a83941e8085068b" 85 | 86 | [[package]] 87 | name = "async-attributes" 88 | version = "1.1.2" 89 | source = "registry+https://github.com/rust-lang/crates.io-index" 90 | checksum = "a3203e79f4dd9bdda415ed03cf14dae5a2bf775c683a00f94e9cd1faf0f596e5" 91 | dependencies = [ 92 | "quote", 93 | "syn", 94 | ] 95 | 96 | [[package]] 97 | name = "async-channel" 98 | version = "1.6.1" 99 | source = "registry+https://github.com/rust-lang/crates.io-index" 100 | checksum = "2114d64672151c0c5eaa5e131ec84a74f06e1e559830dabba01ca30605d66319" 101 | dependencies = [ 102 | "concurrent-queue", 103 | "event-listener", 104 | "futures-core", 105 | ] 106 | 107 | [[package]] 108 | name = "async-dup" 109 | version = "1.2.2" 110 | source = "registry+https://github.com/rust-lang/crates.io-index" 111 | checksum = "7427a12b8dc09291528cfb1da2447059adb4a257388c2acd6497a79d55cf6f7c" 112 | dependencies = [ 113 | "futures-io", 114 | "simple-mutex", 115 | ] 116 | 117 | [[package]] 118 | name = "async-executor" 119 | version = "1.4.1" 120 | source = "registry+https://github.com/rust-lang/crates.io-index" 121 | checksum = "871f9bb5e0a22eeb7e8cf16641feb87c9dc67032ccf8ff49e772eb9941d3a965" 122 | dependencies = [ 123 | "async-task", 124 | "concurrent-queue", 125 | "fastrand", 126 | "futures-lite", 127 | "once_cell", 128 | "slab", 129 | ] 130 | 131 | [[package]] 132 | name = "async-global-executor" 133 | version = "2.0.3" 134 | source = "registry+https://github.com/rust-lang/crates.io-index" 135 | checksum = "c026b7e44f1316b567ee750fea85103f87fcb80792b860e979f221259796ca0a" 136 | dependencies = [ 137 | "async-channel", 138 | "async-executor", 139 | "async-io", 140 | "async-mutex", 141 | "blocking", 142 | "futures-lite", 143 | "num_cpus", 144 | "once_cell", 145 | ] 146 | 147 | [[package]] 148 | name = "async-h1" 149 | version = "2.3.3" 150 | source = "registry+https://github.com/rust-lang/crates.io-index" 151 | checksum = "8101020758a4fc3a7c326cb42aa99e9fa77cbfb76987c128ad956406fe1f70a7" 152 | dependencies = [ 153 | "async-channel", 154 | "async-dup", 155 | "async-std", 156 | "futures-core", 157 | "http-types", 158 | "httparse", 159 | "log", 160 | "pin-project", 161 | ] 162 | 163 | [[package]] 164 | name = "async-io" 165 | version = "1.6.0" 166 | source = "registry+https://github.com/rust-lang/crates.io-index" 167 | checksum = "a811e6a479f2439f0c04038796b5cfb3d2ad56c230e0f2d3f7b04d68cfee607b" 168 | dependencies = [ 169 | "concurrent-queue", 170 | "futures-lite", 171 | "libc", 172 | "log", 173 | "once_cell", 174 | "parking", 175 | "polling", 176 | "slab", 177 | "socket2", 178 | "waker-fn", 179 | "winapi", 180 | ] 181 | 182 | [[package]] 183 | name = "async-lock" 184 | version = "2.5.0" 185 | source = "registry+https://github.com/rust-lang/crates.io-index" 186 | checksum = "e97a171d191782fba31bb902b14ad94e24a68145032b7eedf871ab0bc0d077b6" 187 | dependencies = [ 188 | "event-listener", 189 | ] 190 | 191 | [[package]] 192 | name = "async-mutex" 193 | version = "1.4.0" 194 | source = "registry+https://github.com/rust-lang/crates.io-index" 195 | checksum = "479db852db25d9dbf6204e6cb6253698f175c15726470f78af0d918e99d6156e" 196 | dependencies = [ 197 | "event-listener", 198 | ] 199 | 200 | [[package]] 201 | name = "async-process" 202 | version = "1.3.0" 203 | source = "registry+https://github.com/rust-lang/crates.io-index" 204 | checksum = "83137067e3a2a6a06d67168e49e68a0957d215410473a740cea95a2425c0b7c6" 205 | dependencies = [ 206 | "async-io", 207 | "blocking", 208 | "cfg-if 1.0.0", 209 | "event-listener", 210 | "futures-lite", 211 | "libc", 212 | "once_cell", 213 | "signal-hook", 214 | "winapi", 215 | ] 216 | 217 | [[package]] 218 | name = "async-session" 219 | version = "2.0.1" 220 | source = "registry+https://github.com/rust-lang/crates.io-index" 221 | checksum = "345022a2eed092cd105cc1b26fd61c341e100bd5fcbbd792df4baf31c2cc631f" 222 | dependencies = [ 223 | "anyhow", 224 | "async-std", 225 | "async-trait", 226 | "base64 0.12.3", 227 | "bincode", 228 | "blake3", 229 | "chrono", 230 | "hmac 0.8.1", 231 | "kv-log-macro", 232 | "rand 0.7.3", 233 | "serde", 234 | "serde_json", 235 | "sha2", 236 | ] 237 | 238 | [[package]] 239 | name = "async-sse" 240 | version = "4.1.0" 241 | source = "registry+https://github.com/rust-lang/crates.io-index" 242 | checksum = "53bba003996b8fd22245cd0c59b869ba764188ed435392cf2796d03b805ade10" 243 | dependencies = [ 244 | "async-channel", 245 | "async-std", 246 | "http-types", 247 | "log", 248 | "memchr", 249 | "pin-project-lite 0.1.12", 250 | ] 251 | 252 | [[package]] 253 | name = "async-std" 254 | version = "1.10.0" 255 | source = "registry+https://github.com/rust-lang/crates.io-index" 256 | checksum = "f8056f1455169ab86dd47b47391e4ab0cbd25410a70e9fe675544f49bafaf952" 257 | dependencies = [ 258 | "async-attributes", 259 | "async-channel", 260 | "async-global-executor", 261 | "async-io", 262 | "async-lock", 263 | "async-process", 264 | "crossbeam-utils", 265 | "futures-channel", 266 | "futures-core", 267 | "futures-io", 268 | "futures-lite", 269 | "gloo-timers", 270 | "kv-log-macro", 271 | "log", 272 | "memchr", 273 | "num_cpus", 274 | "once_cell", 275 | "pin-project-lite 0.2.8", 276 | "pin-utils", 277 | "slab", 278 | "wasm-bindgen-futures", 279 | ] 280 | 281 | [[package]] 282 | name = "async-task" 283 | version = "4.1.0" 284 | source = "registry+https://github.com/rust-lang/crates.io-index" 285 | checksum = "677d306121baf53310a3fd342d88dc0824f6bbeace68347593658525565abee8" 286 | 287 | [[package]] 288 | name = "async-trait" 289 | version = "0.1.52" 290 | source = "registry+https://github.com/rust-lang/crates.io-index" 291 | checksum = "061a7acccaa286c011ddc30970520b98fa40e00c9d644633fb26b5fc63a265e3" 292 | dependencies = [ 293 | "proc-macro2", 294 | "quote", 295 | "syn", 296 | ] 297 | 298 | [[package]] 299 | name = "atomic-waker" 300 | version = "1.0.0" 301 | source = "registry+https://github.com/rust-lang/crates.io-index" 302 | checksum = "065374052e7df7ee4047b1160cca5e1467a12351a40b3da123c870ba0b8eda2a" 303 | 304 | [[package]] 305 | name = "atty" 306 | version = "0.2.14" 307 | source = "registry+https://github.com/rust-lang/crates.io-index" 308 | checksum = "d9b39be18770d11421cdb1b9947a45dd3f37e93092cbf377614828a319d5fee8" 309 | dependencies = [ 310 | "hermit-abi", 311 | "libc", 312 | "winapi", 313 | ] 314 | 315 | [[package]] 316 | name = "autocfg" 317 | version = "1.1.0" 318 | source = "registry+https://github.com/rust-lang/crates.io-index" 319 | checksum = "d468802bab17cbc0cc575e9b053f41e72aa36bfa6b7f55e3529ffa43161b97fa" 320 | 321 | [[package]] 322 | name = "base-x" 323 | version = "0.2.8" 324 | source = "registry+https://github.com/rust-lang/crates.io-index" 325 | checksum = "a4521f3e3d031370679b3b140beb36dfe4801b09ac77e30c61941f97df3ef28b" 326 | 327 | [[package]] 328 | name = "base64" 329 | version = "0.12.3" 330 | source = "registry+https://github.com/rust-lang/crates.io-index" 331 | checksum = "3441f0f7b02788e948e47f457ca01f1d7e6d92c693bc132c22b087d3141c03ff" 332 | 333 | [[package]] 334 | name = "base64" 335 | version = "0.13.0" 336 | source = "registry+https://github.com/rust-lang/crates.io-index" 337 | checksum = "904dfeac50f3cdaba28fc6f57fdcddb75f49ed61346676a78c4ffe55877802fd" 338 | 339 | [[package]] 340 | name = "bincode" 341 | version = "1.3.3" 342 | source = "registry+https://github.com/rust-lang/crates.io-index" 343 | checksum = "b1f45e9417d87227c7a56d22e471c6206462cba514c7590c09aff4cf6d1ddcad" 344 | dependencies = [ 345 | "serde", 346 | ] 347 | 348 | [[package]] 349 | name = "bitflags" 350 | version = "1.3.2" 351 | source = "registry+https://github.com/rust-lang/crates.io-index" 352 | checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" 353 | 354 | [[package]] 355 | name = "blake3" 356 | version = "0.3.8" 357 | source = "registry+https://github.com/rust-lang/crates.io-index" 358 | checksum = "b64485778c4f16a6a5a9d335e80d449ac6c70cdd6a06d2af18a6f6f775a125b3" 359 | dependencies = [ 360 | "arrayref", 361 | "arrayvec", 362 | "cc", 363 | "cfg-if 0.1.10", 364 | "constant_time_eq", 365 | "crypto-mac 0.8.0", 366 | "digest", 367 | ] 368 | 369 | [[package]] 370 | name = "block-buffer" 371 | version = "0.9.0" 372 | source = "registry+https://github.com/rust-lang/crates.io-index" 373 | checksum = "4152116fd6e9dadb291ae18fc1ec3575ed6d84c29642d97890f4b4a3417297e4" 374 | dependencies = [ 375 | "generic-array", 376 | ] 377 | 378 | [[package]] 379 | name = "blocking" 380 | version = "1.1.0" 381 | source = "registry+https://github.com/rust-lang/crates.io-index" 382 | checksum = "046e47d4b2d391b1f6f8b407b1deb8dee56c1852ccd868becf2710f601b5f427" 383 | dependencies = [ 384 | "async-channel", 385 | "async-task", 386 | "atomic-waker", 387 | "fastrand", 388 | "futures-lite", 389 | "once_cell", 390 | ] 391 | 392 | [[package]] 393 | name = "bumpalo" 394 | version = "3.9.1" 395 | source = "registry+https://github.com/rust-lang/crates.io-index" 396 | checksum = "a4a45a46ab1f2412e53d3a0ade76ffad2025804294569aae387231a0cd6e0899" 397 | 398 | [[package]] 399 | name = "cache-padded" 400 | version = "1.2.0" 401 | source = "registry+https://github.com/rust-lang/crates.io-index" 402 | checksum = "c1db59621ec70f09c5e9b597b220c7a2b43611f4710dc03ceb8748637775692c" 403 | 404 | [[package]] 405 | name = "cc" 406 | version = "1.0.73" 407 | source = "registry+https://github.com/rust-lang/crates.io-index" 408 | checksum = "2fff2a6927b3bb87f9595d67196a70493f627687a71d87a0d692242c33f58c11" 409 | 410 | [[package]] 411 | name = "cfg-if" 412 | version = "0.1.10" 413 | source = "registry+https://github.com/rust-lang/crates.io-index" 414 | checksum = "4785bdd1c96b2a846b2bd7cc02e86b6b3dbf14e7e53446c4f54c92a361040822" 415 | 416 | [[package]] 417 | name = "cfg-if" 418 | version = "1.0.0" 419 | source = "registry+https://github.com/rust-lang/crates.io-index" 420 | checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" 421 | 422 | [[package]] 423 | name = "chrono" 424 | version = "0.4.19" 425 | source = "registry+https://github.com/rust-lang/crates.io-index" 426 | checksum = "670ad68c9088c2a963aaa298cb369688cf3f9465ce5e2d4ca10e6e0098a1ce73" 427 | dependencies = [ 428 | "libc", 429 | "num-integer", 430 | "num-traits", 431 | "serde", 432 | "time 0.1.44", 433 | "winapi", 434 | ] 435 | 436 | [[package]] 437 | name = "cipher" 438 | version = "0.2.5" 439 | source = "registry+https://github.com/rust-lang/crates.io-index" 440 | checksum = "12f8e7987cbd042a63249497f41aed09f8e65add917ea6566effbc56578d6801" 441 | dependencies = [ 442 | "generic-array", 443 | ] 444 | 445 | [[package]] 446 | name = "clap" 447 | version = "2.34.0" 448 | source = "registry+https://github.com/rust-lang/crates.io-index" 449 | checksum = "a0610544180c38b88101fecf2dd634b174a62eef6946f84dfc6a7127512b381c" 450 | dependencies = [ 451 | "ansi_term", 452 | "atty", 453 | "bitflags", 454 | "strsim", 455 | "textwrap", 456 | "unicode-width", 457 | "vec_map", 458 | ] 459 | 460 | [[package]] 461 | name = "concurrent-queue" 462 | version = "1.2.2" 463 | source = "registry+https://github.com/rust-lang/crates.io-index" 464 | checksum = "30ed07550be01594c6026cff2a1d7fe9c8f683caa798e12b68694ac9e88286a3" 465 | dependencies = [ 466 | "cache-padded", 467 | ] 468 | 469 | [[package]] 470 | name = "const_fn" 471 | version = "0.4.9" 472 | source = "registry+https://github.com/rust-lang/crates.io-index" 473 | checksum = "fbdcdcb6d86f71c5e97409ad45898af11cbc995b4ee8112d59095a28d376c935" 474 | 475 | [[package]] 476 | name = "constant_time_eq" 477 | version = "0.1.5" 478 | source = "registry+https://github.com/rust-lang/crates.io-index" 479 | checksum = "245097e9a4535ee1e3e3931fcfcd55a796a44c643e8596ff6566d68f09b87bbc" 480 | 481 | [[package]] 482 | name = "cookie" 483 | version = "0.14.4" 484 | source = "registry+https://github.com/rust-lang/crates.io-index" 485 | checksum = "03a5d7b21829bc7b4bf4754a978a241ae54ea55a40f92bb20216e54096f4b951" 486 | dependencies = [ 487 | "aes-gcm", 488 | "base64 0.13.0", 489 | "hkdf", 490 | "hmac 0.10.1", 491 | "percent-encoding", 492 | "rand 0.8.5", 493 | "sha2", 494 | "time 0.2.27", 495 | "version_check", 496 | ] 497 | 498 | [[package]] 499 | name = "cpufeatures" 500 | version = "0.2.1" 501 | source = "registry+https://github.com/rust-lang/crates.io-index" 502 | checksum = "95059428f66df56b63431fdb4e1947ed2190586af5c5a8a8b71122bdf5a7f469" 503 | dependencies = [ 504 | "libc", 505 | ] 506 | 507 | [[package]] 508 | name = "cpuid-bool" 509 | version = "0.2.0" 510 | source = "registry+https://github.com/rust-lang/crates.io-index" 511 | checksum = "dcb25d077389e53838a8158c8e99174c5a9d902dee4904320db714f3c653ffba" 512 | 513 | [[package]] 514 | name = "crossbeam-utils" 515 | version = "0.8.7" 516 | source = "registry+https://github.com/rust-lang/crates.io-index" 517 | checksum = "b5e5bed1f1c269533fa816a0a5492b3545209a205ca1a54842be180eb63a16a6" 518 | dependencies = [ 519 | "cfg-if 1.0.0", 520 | "lazy_static", 521 | ] 522 | 523 | [[package]] 524 | name = "crypto-mac" 525 | version = "0.8.0" 526 | source = "registry+https://github.com/rust-lang/crates.io-index" 527 | checksum = "b584a330336237c1eecd3e94266efb216c56ed91225d634cb2991c5f3fd1aeab" 528 | dependencies = [ 529 | "generic-array", 530 | "subtle", 531 | ] 532 | 533 | [[package]] 534 | name = "crypto-mac" 535 | version = "0.10.1" 536 | source = "registry+https://github.com/rust-lang/crates.io-index" 537 | checksum = "bff07008ec701e8028e2ceb8f83f0e4274ee62bd2dbdc4fefff2e9a91824081a" 538 | dependencies = [ 539 | "generic-array", 540 | "subtle", 541 | ] 542 | 543 | [[package]] 544 | name = "ctor" 545 | version = "0.1.21" 546 | source = "registry+https://github.com/rust-lang/crates.io-index" 547 | checksum = "ccc0a48a9b826acdf4028595adc9db92caea352f7af011a3034acd172a52a0aa" 548 | dependencies = [ 549 | "quote", 550 | "syn", 551 | ] 552 | 553 | [[package]] 554 | name = "ctr" 555 | version = "0.6.0" 556 | source = "registry+https://github.com/rust-lang/crates.io-index" 557 | checksum = "fb4a30d54f7443bf3d6191dcd486aca19e67cb3c49fa7a06a319966346707e7f" 558 | dependencies = [ 559 | "cipher", 560 | ] 561 | 562 | [[package]] 563 | name = "dashmap" 564 | version = "4.0.2" 565 | source = "registry+https://github.com/rust-lang/crates.io-index" 566 | checksum = "e77a43b28d0668df09411cb0bc9a8c2adc40f9a048afe863e05fd43251e8e39c" 567 | dependencies = [ 568 | "cfg-if 1.0.0", 569 | "num_cpus", 570 | ] 571 | 572 | [[package]] 573 | name = "digest" 574 | version = "0.9.0" 575 | source = "registry+https://github.com/rust-lang/crates.io-index" 576 | checksum = "d3dd60d1080a57a05ab032377049e0591415d2b31afd7028356dbf3cc6dcb066" 577 | dependencies = [ 578 | "generic-array", 579 | ] 580 | 581 | [[package]] 582 | name = "discard" 583 | version = "1.0.4" 584 | source = "registry+https://github.com/rust-lang/crates.io-index" 585 | checksum = "212d0f5754cb6769937f4501cc0e67f4f4483c8d2c3e1e922ee9edbe4ab4c7c0" 586 | 587 | [[package]] 588 | name = "event-listener" 589 | version = "2.5.2" 590 | source = "registry+https://github.com/rust-lang/crates.io-index" 591 | checksum = "77f3309417938f28bf8228fcff79a4a37103981e3e186d2ccd19c74b38f4eb71" 592 | 593 | [[package]] 594 | name = "fastrand" 595 | version = "1.7.0" 596 | source = "registry+https://github.com/rust-lang/crates.io-index" 597 | checksum = "c3fcf0cee53519c866c09b5de1f6c56ff9d647101f81c1964fa632e148896cdf" 598 | dependencies = [ 599 | "instant", 600 | ] 601 | 602 | [[package]] 603 | name = "femme" 604 | version = "2.1.1" 605 | source = "registry+https://github.com/rust-lang/crates.io-index" 606 | checksum = "2af1a24f391a5a94d756db5092c6576aad494b88a71a5a36b20c67b63e0df034" 607 | dependencies = [ 608 | "cfg-if 0.1.10", 609 | "js-sys", 610 | "log", 611 | "serde", 612 | "serde_derive", 613 | "serde_json", 614 | "wasm-bindgen", 615 | "web-sys", 616 | ] 617 | 618 | [[package]] 619 | name = "form_urlencoded" 620 | version = "1.0.1" 621 | source = "registry+https://github.com/rust-lang/crates.io-index" 622 | checksum = "5fc25a87fa4fd2094bffb06925852034d90a17f0d1e05197d4956d3555752191" 623 | dependencies = [ 624 | "matches", 625 | "percent-encoding", 626 | ] 627 | 628 | [[package]] 629 | name = "futures-channel" 630 | version = "0.3.21" 631 | source = "registry+https://github.com/rust-lang/crates.io-index" 632 | checksum = "c3083ce4b914124575708913bca19bfe887522d6e2e6d0952943f5eac4a74010" 633 | dependencies = [ 634 | "futures-core", 635 | ] 636 | 637 | [[package]] 638 | name = "futures-core" 639 | version = "0.3.21" 640 | source = "registry+https://github.com/rust-lang/crates.io-index" 641 | checksum = "0c09fd04b7e4073ac7156a9539b57a484a8ea920f79c7c675d05d289ab6110d3" 642 | 643 | [[package]] 644 | name = "futures-io" 645 | version = "0.3.21" 646 | source = "registry+https://github.com/rust-lang/crates.io-index" 647 | checksum = "fc4045962a5a5e935ee2fdedaa4e08284547402885ab326734432bed5d12966b" 648 | 649 | [[package]] 650 | name = "futures-lite" 651 | version = "1.12.0" 652 | source = "registry+https://github.com/rust-lang/crates.io-index" 653 | checksum = "7694489acd39452c77daa48516b894c153f192c3578d5a839b62c58099fcbf48" 654 | dependencies = [ 655 | "fastrand", 656 | "futures-core", 657 | "futures-io", 658 | "memchr", 659 | "parking", 660 | "pin-project-lite 0.2.8", 661 | "waker-fn", 662 | ] 663 | 664 | [[package]] 665 | name = "futures-macro" 666 | version = "0.3.21" 667 | source = "registry+https://github.com/rust-lang/crates.io-index" 668 | checksum = "33c1e13800337f4d4d7a316bf45a567dbcb6ffe087f16424852d97e97a91f512" 669 | dependencies = [ 670 | "proc-macro2", 671 | "quote", 672 | "syn", 673 | ] 674 | 675 | [[package]] 676 | name = "futures-task" 677 | version = "0.3.21" 678 | source = "registry+https://github.com/rust-lang/crates.io-index" 679 | checksum = "57c66a976bf5909d801bbef33416c41372779507e7a6b3a5e25e4749c58f776a" 680 | 681 | [[package]] 682 | name = "futures-util" 683 | version = "0.3.21" 684 | source = "registry+https://github.com/rust-lang/crates.io-index" 685 | checksum = "d8b7abd5d659d9b90c8cba917f6ec750a74e2dc23902ef9cd4cc8c8b22e6036a" 686 | dependencies = [ 687 | "futures-core", 688 | "futures-macro", 689 | "futures-task", 690 | "pin-project-lite 0.2.8", 691 | "pin-utils", 692 | "slab", 693 | ] 694 | 695 | [[package]] 696 | name = "generic-array" 697 | version = "0.14.5" 698 | source = "registry+https://github.com/rust-lang/crates.io-index" 699 | checksum = "fd48d33ec7f05fbfa152300fdad764757cbded343c1aa1cff2fbaf4134851803" 700 | dependencies = [ 701 | "typenum", 702 | "version_check", 703 | ] 704 | 705 | [[package]] 706 | name = "getrandom" 707 | version = "0.1.16" 708 | source = "registry+https://github.com/rust-lang/crates.io-index" 709 | checksum = "8fc3cb4d91f53b50155bdcfd23f6a4c39ae1969c2ae85982b135750cccaf5fce" 710 | dependencies = [ 711 | "cfg-if 1.0.0", 712 | "libc", 713 | "wasi 0.9.0+wasi-snapshot-preview1", 714 | ] 715 | 716 | [[package]] 717 | name = "getrandom" 718 | version = "0.2.5" 719 | source = "registry+https://github.com/rust-lang/crates.io-index" 720 | checksum = "d39cd93900197114fa1fcb7ae84ca742095eed9442088988ae74fa744e930e77" 721 | dependencies = [ 722 | "cfg-if 1.0.0", 723 | "libc", 724 | "wasi 0.10.0+wasi-snapshot-preview1", 725 | ] 726 | 727 | [[package]] 728 | name = "ghash" 729 | version = "0.3.1" 730 | source = "registry+https://github.com/rust-lang/crates.io-index" 731 | checksum = "97304e4cd182c3846f7575ced3890c53012ce534ad9114046b0a9e00bb30a375" 732 | dependencies = [ 733 | "opaque-debug", 734 | "polyval", 735 | ] 736 | 737 | [[package]] 738 | name = "gloo-timers" 739 | version = "0.2.3" 740 | source = "registry+https://github.com/rust-lang/crates.io-index" 741 | checksum = "4d12a7f4e95cfe710f1d624fb1210b7d961a5fb05c4fd942f4feab06e61f590e" 742 | dependencies = [ 743 | "futures-channel", 744 | "futures-core", 745 | "js-sys", 746 | "wasm-bindgen", 747 | ] 748 | 749 | [[package]] 750 | name = "heck" 751 | version = "0.3.3" 752 | source = "registry+https://github.com/rust-lang/crates.io-index" 753 | checksum = "6d621efb26863f0e9924c6ac577e8275e5e6b77455db64ffa6c65c904e9e132c" 754 | dependencies = [ 755 | "unicode-segmentation", 756 | ] 757 | 758 | [[package]] 759 | name = "hermit-abi" 760 | version = "0.1.19" 761 | source = "registry+https://github.com/rust-lang/crates.io-index" 762 | checksum = "62b467343b94ba476dcb2500d242dadbb39557df889310ac77c5d99100aaac33" 763 | dependencies = [ 764 | "libc", 765 | ] 766 | 767 | [[package]] 768 | name = "hkdf" 769 | version = "0.10.0" 770 | source = "registry+https://github.com/rust-lang/crates.io-index" 771 | checksum = "51ab2f639c231793c5f6114bdb9bbe50a7dbbfcd7c7c6bd8475dec2d991e964f" 772 | dependencies = [ 773 | "digest", 774 | "hmac 0.10.1", 775 | ] 776 | 777 | [[package]] 778 | name = "hmac" 779 | version = "0.8.1" 780 | source = "registry+https://github.com/rust-lang/crates.io-index" 781 | checksum = "126888268dcc288495a26bf004b38c5fdbb31682f992c84ceb046a1f0fe38840" 782 | dependencies = [ 783 | "crypto-mac 0.8.0", 784 | "digest", 785 | ] 786 | 787 | [[package]] 788 | name = "hmac" 789 | version = "0.10.1" 790 | source = "registry+https://github.com/rust-lang/crates.io-index" 791 | checksum = "c1441c6b1e930e2817404b5046f1f989899143a12bf92de603b69f4e0aee1e15" 792 | dependencies = [ 793 | "crypto-mac 0.10.1", 794 | "digest", 795 | ] 796 | 797 | [[package]] 798 | name = "http-client" 799 | version = "6.5.1" 800 | source = "registry+https://github.com/rust-lang/crates.io-index" 801 | checksum = "ea880b03c18a7e981d7fb3608b8904a98425d53c440758fcebf7d934aa56547c" 802 | dependencies = [ 803 | "async-trait", 804 | "cfg-if 1.0.0", 805 | "dashmap", 806 | "http-types", 807 | "log", 808 | ] 809 | 810 | [[package]] 811 | name = "http-types" 812 | version = "2.12.0" 813 | source = "registry+https://github.com/rust-lang/crates.io-index" 814 | checksum = "6e9b187a72d63adbfba487f48095306ac823049cb504ee195541e91c7775f5ad" 815 | dependencies = [ 816 | "anyhow", 817 | "async-channel", 818 | "async-std", 819 | "base64 0.13.0", 820 | "cookie", 821 | "futures-lite", 822 | "infer", 823 | "pin-project-lite 0.2.8", 824 | "rand 0.7.3", 825 | "serde", 826 | "serde_json", 827 | "serde_qs", 828 | "serde_urlencoded", 829 | "url", 830 | ] 831 | 832 | [[package]] 833 | name = "httparse" 834 | version = "1.6.0" 835 | source = "registry+https://github.com/rust-lang/crates.io-index" 836 | checksum = "9100414882e15fb7feccb4897e5f0ff0ff1ca7d1a86a23208ada4d7a18e6c6c4" 837 | 838 | [[package]] 839 | name = "idna" 840 | version = "0.2.3" 841 | source = "registry+https://github.com/rust-lang/crates.io-index" 842 | checksum = "418a0a6fab821475f634efe3ccc45c013f742efe03d853e8d3355d5cb850ecf8" 843 | dependencies = [ 844 | "matches", 845 | "unicode-bidi", 846 | "unicode-normalization", 847 | ] 848 | 849 | [[package]] 850 | name = "infer" 851 | version = "0.2.3" 852 | source = "registry+https://github.com/rust-lang/crates.io-index" 853 | checksum = "64e9829a50b42bb782c1df523f78d332fe371b10c661e78b7a3c34b0198e9fac" 854 | 855 | [[package]] 856 | name = "instant" 857 | version = "0.1.12" 858 | source = "registry+https://github.com/rust-lang/crates.io-index" 859 | checksum = "7a5bbe824c507c5da5956355e86a746d82e0e1464f65d862cc5e71da70e94b2c" 860 | dependencies = [ 861 | "cfg-if 1.0.0", 862 | ] 863 | 864 | [[package]] 865 | name = "itoa" 866 | version = "1.0.1" 867 | source = "registry+https://github.com/rust-lang/crates.io-index" 868 | checksum = "1aab8fc367588b89dcee83ab0fd66b72b50b72fa1904d7095045ace2b0c81c35" 869 | 870 | [[package]] 871 | name = "js-sys" 872 | version = "0.3.56" 873 | source = "registry+https://github.com/rust-lang/crates.io-index" 874 | checksum = "a38fc24e30fd564ce974c02bf1d337caddff65be6cc4735a1f7eab22a7440f04" 875 | dependencies = [ 876 | "wasm-bindgen", 877 | ] 878 | 879 | [[package]] 880 | name = "kv-log-macro" 881 | version = "1.0.7" 882 | source = "registry+https://github.com/rust-lang/crates.io-index" 883 | checksum = "0de8b303297635ad57c9f5059fd9cee7a47f8e8daa09df0fcd07dd39fb22977f" 884 | dependencies = [ 885 | "log", 886 | ] 887 | 888 | [[package]] 889 | name = "lazy_static" 890 | version = "1.4.0" 891 | source = "registry+https://github.com/rust-lang/crates.io-index" 892 | checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646" 893 | 894 | [[package]] 895 | name = "libc" 896 | version = "0.2.119" 897 | source = "registry+https://github.com/rust-lang/crates.io-index" 898 | checksum = "1bf2e165bb3457c8e098ea76f3e3bc9db55f87aa90d52d0e6be741470916aaa4" 899 | 900 | [[package]] 901 | name = "log" 902 | version = "0.4.14" 903 | source = "registry+https://github.com/rust-lang/crates.io-index" 904 | checksum = "51b9bbe6c47d51fc3e1a9b945965946b4c44142ab8792c50835a980d362c2710" 905 | dependencies = [ 906 | "cfg-if 1.0.0", 907 | "value-bag", 908 | ] 909 | 910 | [[package]] 911 | name = "matches" 912 | version = "0.1.9" 913 | source = "registry+https://github.com/rust-lang/crates.io-index" 914 | checksum = "a3e378b66a060d48947b590737b30a1be76706c8dd7b8ba0f2fe3989c68a853f" 915 | 916 | [[package]] 917 | name = "memchr" 918 | version = "2.4.1" 919 | source = "registry+https://github.com/rust-lang/crates.io-index" 920 | checksum = "308cc39be01b73d0d18f82a0e7b2a3df85245f84af96fdddc5d202d27e47b86a" 921 | 922 | [[package]] 923 | name = "num-integer" 924 | version = "0.1.44" 925 | source = "registry+https://github.com/rust-lang/crates.io-index" 926 | checksum = "d2cc698a63b549a70bc047073d2949cce27cd1c7b0a4a862d08a8031bc2801db" 927 | dependencies = [ 928 | "autocfg", 929 | "num-traits", 930 | ] 931 | 932 | [[package]] 933 | name = "num-traits" 934 | version = "0.2.14" 935 | source = "registry+https://github.com/rust-lang/crates.io-index" 936 | checksum = "9a64b1ec5cda2586e284722486d802acf1f7dbdc623e2bfc57e65ca1cd099290" 937 | dependencies = [ 938 | "autocfg", 939 | ] 940 | 941 | [[package]] 942 | name = "num_cpus" 943 | version = "1.13.1" 944 | source = "registry+https://github.com/rust-lang/crates.io-index" 945 | checksum = "19e64526ebdee182341572e50e9ad03965aa510cd94427a4549448f285e957a1" 946 | dependencies = [ 947 | "hermit-abi", 948 | "libc", 949 | ] 950 | 951 | [[package]] 952 | name = "once_cell" 953 | version = "1.9.0" 954 | source = "registry+https://github.com/rust-lang/crates.io-index" 955 | checksum = "da32515d9f6e6e489d7bc9d84c71b060db7247dc035bbe44eac88cf87486d8d5" 956 | 957 | [[package]] 958 | name = "opaque-debug" 959 | version = "0.3.0" 960 | source = "registry+https://github.com/rust-lang/crates.io-index" 961 | checksum = "624a8340c38c1b80fd549087862da4ba43e08858af025b236e509b6649fc13d5" 962 | 963 | [[package]] 964 | name = "parking" 965 | version = "2.0.0" 966 | source = "registry+https://github.com/rust-lang/crates.io-index" 967 | checksum = "427c3892f9e783d91cc128285287e70a59e206ca452770ece88a76f7a3eddd72" 968 | 969 | [[package]] 970 | name = "percent-encoding" 971 | version = "2.1.0" 972 | source = "registry+https://github.com/rust-lang/crates.io-index" 973 | checksum = "d4fd5641d01c8f18a23da7b6fe29298ff4b55afcccdf78973b24cf3175fee32e" 974 | 975 | [[package]] 976 | name = "pin-project" 977 | version = "1.0.10" 978 | source = "registry+https://github.com/rust-lang/crates.io-index" 979 | checksum = "58ad3879ad3baf4e44784bc6a718a8698867bb991f8ce24d1bcbe2cfb4c3a75e" 980 | dependencies = [ 981 | "pin-project-internal", 982 | ] 983 | 984 | [[package]] 985 | name = "pin-project-internal" 986 | version = "1.0.10" 987 | source = "registry+https://github.com/rust-lang/crates.io-index" 988 | checksum = "744b6f092ba29c3650faf274db506afd39944f48420f6c86b17cfe0ee1cb36bb" 989 | dependencies = [ 990 | "proc-macro2", 991 | "quote", 992 | "syn", 993 | ] 994 | 995 | [[package]] 996 | name = "pin-project-lite" 997 | version = "0.1.12" 998 | source = "registry+https://github.com/rust-lang/crates.io-index" 999 | checksum = "257b64915a082f7811703966789728173279bdebb956b143dbcd23f6f970a777" 1000 | 1001 | [[package]] 1002 | name = "pin-project-lite" 1003 | version = "0.2.8" 1004 | source = "registry+https://github.com/rust-lang/crates.io-index" 1005 | checksum = "e280fbe77cc62c91527259e9442153f4688736748d24660126286329742b4c6c" 1006 | 1007 | [[package]] 1008 | name = "pin-utils" 1009 | version = "0.1.0" 1010 | source = "registry+https://github.com/rust-lang/crates.io-index" 1011 | checksum = "8b870d8c151b6f2fb93e84a13146138f05d02ed11c7e7c54f8826aaaf7c9f184" 1012 | 1013 | [[package]] 1014 | name = "polling" 1015 | version = "2.2.0" 1016 | source = "registry+https://github.com/rust-lang/crates.io-index" 1017 | checksum = "685404d509889fade3e86fe3a5803bca2ec09b0c0778d5ada6ec8bf7a8de5259" 1018 | dependencies = [ 1019 | "cfg-if 1.0.0", 1020 | "libc", 1021 | "log", 1022 | "wepoll-ffi", 1023 | "winapi", 1024 | ] 1025 | 1026 | [[package]] 1027 | name = "polyval" 1028 | version = "0.4.5" 1029 | source = "registry+https://github.com/rust-lang/crates.io-index" 1030 | checksum = "eebcc4aa140b9abd2bc40d9c3f7ccec842679cd79045ac3a7ac698c1a064b7cd" 1031 | dependencies = [ 1032 | "cpuid-bool", 1033 | "opaque-debug", 1034 | "universal-hash", 1035 | ] 1036 | 1037 | [[package]] 1038 | name = "ppv-lite86" 1039 | version = "0.2.16" 1040 | source = "registry+https://github.com/rust-lang/crates.io-index" 1041 | checksum = "eb9f9e6e233e5c4a35559a617bf40a4ec447db2e84c20b55a6f83167b7e57872" 1042 | 1043 | [[package]] 1044 | name = "proc-macro-error" 1045 | version = "1.0.4" 1046 | source = "registry+https://github.com/rust-lang/crates.io-index" 1047 | checksum = "da25490ff9892aab3fcf7c36f08cfb902dd3e71ca0f9f9517bea02a73a5ce38c" 1048 | dependencies = [ 1049 | "proc-macro-error-attr", 1050 | "proc-macro2", 1051 | "quote", 1052 | "syn", 1053 | "version_check", 1054 | ] 1055 | 1056 | [[package]] 1057 | name = "proc-macro-error-attr" 1058 | version = "1.0.4" 1059 | source = "registry+https://github.com/rust-lang/crates.io-index" 1060 | checksum = "a1be40180e52ecc98ad80b184934baf3d0d29f979574e439af5a55274b35f869" 1061 | dependencies = [ 1062 | "proc-macro2", 1063 | "quote", 1064 | "version_check", 1065 | ] 1066 | 1067 | [[package]] 1068 | name = "proc-macro-hack" 1069 | version = "0.5.19" 1070 | source = "registry+https://github.com/rust-lang/crates.io-index" 1071 | checksum = "dbf0c48bc1d91375ae5c3cd81e3722dff1abcf81a30960240640d223f59fe0e5" 1072 | 1073 | [[package]] 1074 | name = "proc-macro2" 1075 | version = "1.0.36" 1076 | source = "registry+https://github.com/rust-lang/crates.io-index" 1077 | checksum = "c7342d5883fbccae1cc37a2353b09c87c9b0f3afd73f5fb9bba687a1f733b029" 1078 | dependencies = [ 1079 | "unicode-xid", 1080 | ] 1081 | 1082 | [[package]] 1083 | name = "quote" 1084 | version = "1.0.15" 1085 | source = "registry+https://github.com/rust-lang/crates.io-index" 1086 | checksum = "864d3e96a899863136fc6e99f3d7cae289dafe43bf2c5ac19b70df7210c0a145" 1087 | dependencies = [ 1088 | "proc-macro2", 1089 | ] 1090 | 1091 | [[package]] 1092 | name = "rand" 1093 | version = "0.7.3" 1094 | source = "registry+https://github.com/rust-lang/crates.io-index" 1095 | checksum = "6a6b1679d49b24bbfe0c803429aa1874472f50d9b363131f0e89fc356b544d03" 1096 | dependencies = [ 1097 | "getrandom 0.1.16", 1098 | "libc", 1099 | "rand_chacha 0.2.2", 1100 | "rand_core 0.5.1", 1101 | "rand_hc", 1102 | ] 1103 | 1104 | [[package]] 1105 | name = "rand" 1106 | version = "0.8.5" 1107 | source = "registry+https://github.com/rust-lang/crates.io-index" 1108 | checksum = "34af8d1a0e25924bc5b7c43c079c942339d8f0a8b57c39049bef581b46327404" 1109 | dependencies = [ 1110 | "libc", 1111 | "rand_chacha 0.3.1", 1112 | "rand_core 0.6.3", 1113 | ] 1114 | 1115 | [[package]] 1116 | name = "rand_chacha" 1117 | version = "0.2.2" 1118 | source = "registry+https://github.com/rust-lang/crates.io-index" 1119 | checksum = "f4c8ed856279c9737206bf725bf36935d8666ead7aa69b52be55af369d193402" 1120 | dependencies = [ 1121 | "ppv-lite86", 1122 | "rand_core 0.5.1", 1123 | ] 1124 | 1125 | [[package]] 1126 | name = "rand_chacha" 1127 | version = "0.3.1" 1128 | source = "registry+https://github.com/rust-lang/crates.io-index" 1129 | checksum = "e6c10a63a0fa32252be49d21e7709d4d4baf8d231c2dbce1eaa8141b9b127d88" 1130 | dependencies = [ 1131 | "ppv-lite86", 1132 | "rand_core 0.6.3", 1133 | ] 1134 | 1135 | [[package]] 1136 | name = "rand_core" 1137 | version = "0.5.1" 1138 | source = "registry+https://github.com/rust-lang/crates.io-index" 1139 | checksum = "90bde5296fc891b0cef12a6d03ddccc162ce7b2aff54160af9338f8d40df6d19" 1140 | dependencies = [ 1141 | "getrandom 0.1.16", 1142 | ] 1143 | 1144 | [[package]] 1145 | name = "rand_core" 1146 | version = "0.6.3" 1147 | source = "registry+https://github.com/rust-lang/crates.io-index" 1148 | checksum = "d34f1408f55294453790c48b2f1ebbb1c5b4b7563eb1f418bcfcfdbb06ebb4e7" 1149 | dependencies = [ 1150 | "getrandom 0.2.5", 1151 | ] 1152 | 1153 | [[package]] 1154 | name = "rand_hc" 1155 | version = "0.2.0" 1156 | source = "registry+https://github.com/rust-lang/crates.io-index" 1157 | checksum = "ca3129af7b92a17112d59ad498c6f81eaf463253766b90396d39ea7a39d6613c" 1158 | dependencies = [ 1159 | "rand_core 0.5.1", 1160 | ] 1161 | 1162 | [[package]] 1163 | name = "route-recognizer" 1164 | version = "0.2.0" 1165 | source = "registry+https://github.com/rust-lang/crates.io-index" 1166 | checksum = "56770675ebc04927ded3e60633437841581c285dc6236109ea25fbf3beb7b59e" 1167 | 1168 | [[package]] 1169 | name = "rust-web-boilerplate" 1170 | version = "0.1.0" 1171 | dependencies = [ 1172 | "async-std", 1173 | "structopt", 1174 | "tide", 1175 | ] 1176 | 1177 | [[package]] 1178 | name = "rustc_version" 1179 | version = "0.2.3" 1180 | source = "registry+https://github.com/rust-lang/crates.io-index" 1181 | checksum = "138e3e0acb6c9fb258b19b67cb8abd63c00679d2851805ea151465464fe9030a" 1182 | dependencies = [ 1183 | "semver", 1184 | ] 1185 | 1186 | [[package]] 1187 | name = "ryu" 1188 | version = "1.0.9" 1189 | source = "registry+https://github.com/rust-lang/crates.io-index" 1190 | checksum = "73b4b750c782965c211b42f022f59af1fbceabdd026623714f104152f1ec149f" 1191 | 1192 | [[package]] 1193 | name = "semver" 1194 | version = "0.9.0" 1195 | source = "registry+https://github.com/rust-lang/crates.io-index" 1196 | checksum = "1d7eb9ef2c18661902cc47e535f9bc51b78acd254da71d375c2f6720d9a40403" 1197 | dependencies = [ 1198 | "semver-parser", 1199 | ] 1200 | 1201 | [[package]] 1202 | name = "semver-parser" 1203 | version = "0.7.0" 1204 | source = "registry+https://github.com/rust-lang/crates.io-index" 1205 | checksum = "388a1df253eca08550bef6c72392cfe7c30914bf41df5269b68cbd6ff8f570a3" 1206 | 1207 | [[package]] 1208 | name = "serde" 1209 | version = "1.0.136" 1210 | source = "registry+https://github.com/rust-lang/crates.io-index" 1211 | checksum = "ce31e24b01e1e524df96f1c2fdd054405f8d7376249a5110886fb4b658484789" 1212 | dependencies = [ 1213 | "serde_derive", 1214 | ] 1215 | 1216 | [[package]] 1217 | name = "serde_derive" 1218 | version = "1.0.136" 1219 | source = "registry+https://github.com/rust-lang/crates.io-index" 1220 | checksum = "08597e7152fcd306f41838ed3e37be9eaeed2b61c42e2117266a554fab4662f9" 1221 | dependencies = [ 1222 | "proc-macro2", 1223 | "quote", 1224 | "syn", 1225 | ] 1226 | 1227 | [[package]] 1228 | name = "serde_json" 1229 | version = "1.0.79" 1230 | source = "registry+https://github.com/rust-lang/crates.io-index" 1231 | checksum = "8e8d9fa5c3b304765ce1fd9c4c8a3de2c8db365a5b91be52f186efc675681d95" 1232 | dependencies = [ 1233 | "itoa", 1234 | "ryu", 1235 | "serde", 1236 | ] 1237 | 1238 | [[package]] 1239 | name = "serde_qs" 1240 | version = "0.8.5" 1241 | source = "registry+https://github.com/rust-lang/crates.io-index" 1242 | checksum = "c7715380eec75f029a4ef7de39a9200e0a63823176b759d055b613f5a87df6a6" 1243 | dependencies = [ 1244 | "percent-encoding", 1245 | "serde", 1246 | "thiserror", 1247 | ] 1248 | 1249 | [[package]] 1250 | name = "serde_urlencoded" 1251 | version = "0.7.1" 1252 | source = "registry+https://github.com/rust-lang/crates.io-index" 1253 | checksum = "d3491c14715ca2294c4d6a88f15e84739788c1d030eed8c110436aafdaa2f3fd" 1254 | dependencies = [ 1255 | "form_urlencoded", 1256 | "itoa", 1257 | "ryu", 1258 | "serde", 1259 | ] 1260 | 1261 | [[package]] 1262 | name = "sha1" 1263 | version = "0.6.1" 1264 | source = "registry+https://github.com/rust-lang/crates.io-index" 1265 | checksum = "c1da05c97445caa12d05e848c4a4fcbbea29e748ac28f7e80e9b010392063770" 1266 | dependencies = [ 1267 | "sha1_smol", 1268 | ] 1269 | 1270 | [[package]] 1271 | name = "sha1_smol" 1272 | version = "1.0.0" 1273 | source = "registry+https://github.com/rust-lang/crates.io-index" 1274 | checksum = "ae1a47186c03a32177042e55dbc5fd5aee900b8e0069a8d70fba96a9375cd012" 1275 | 1276 | [[package]] 1277 | name = "sha2" 1278 | version = "0.9.9" 1279 | source = "registry+https://github.com/rust-lang/crates.io-index" 1280 | checksum = "4d58a1e1bf39749807d89cf2d98ac2dfa0ff1cb3faa38fbb64dd88ac8013d800" 1281 | dependencies = [ 1282 | "block-buffer", 1283 | "cfg-if 1.0.0", 1284 | "cpufeatures", 1285 | "digest", 1286 | "opaque-debug", 1287 | ] 1288 | 1289 | [[package]] 1290 | name = "signal-hook" 1291 | version = "0.3.13" 1292 | source = "registry+https://github.com/rust-lang/crates.io-index" 1293 | checksum = "647c97df271007dcea485bb74ffdb57f2e683f1306c854f468a0c244badabf2d" 1294 | dependencies = [ 1295 | "libc", 1296 | "signal-hook-registry", 1297 | ] 1298 | 1299 | [[package]] 1300 | name = "signal-hook-registry" 1301 | version = "1.4.0" 1302 | source = "registry+https://github.com/rust-lang/crates.io-index" 1303 | checksum = "e51e73328dc4ac0c7ccbda3a494dfa03df1de2f46018127f60c693f2648455b0" 1304 | dependencies = [ 1305 | "libc", 1306 | ] 1307 | 1308 | [[package]] 1309 | name = "simple-mutex" 1310 | version = "1.1.5" 1311 | source = "registry+https://github.com/rust-lang/crates.io-index" 1312 | checksum = "38aabbeafa6f6dead8cebf246fe9fae1f9215c8d29b3a69f93bd62a9e4a3dcd6" 1313 | dependencies = [ 1314 | "event-listener", 1315 | ] 1316 | 1317 | [[package]] 1318 | name = "slab" 1319 | version = "0.4.5" 1320 | source = "registry+https://github.com/rust-lang/crates.io-index" 1321 | checksum = "9def91fd1e018fe007022791f865d0ccc9b3a0d5001e01aabb8b40e46000afb5" 1322 | 1323 | [[package]] 1324 | name = "socket2" 1325 | version = "0.4.4" 1326 | source = "registry+https://github.com/rust-lang/crates.io-index" 1327 | checksum = "66d72b759436ae32898a2af0a14218dbf55efde3feeb170eb623637db85ee1e0" 1328 | dependencies = [ 1329 | "libc", 1330 | "winapi", 1331 | ] 1332 | 1333 | [[package]] 1334 | name = "standback" 1335 | version = "0.2.17" 1336 | source = "registry+https://github.com/rust-lang/crates.io-index" 1337 | checksum = "e113fb6f3de07a243d434a56ec6f186dfd51cb08448239fe7bcae73f87ff28ff" 1338 | dependencies = [ 1339 | "version_check", 1340 | ] 1341 | 1342 | [[package]] 1343 | name = "stdweb" 1344 | version = "0.4.20" 1345 | source = "registry+https://github.com/rust-lang/crates.io-index" 1346 | checksum = "d022496b16281348b52d0e30ae99e01a73d737b2f45d38fed4edf79f9325a1d5" 1347 | dependencies = [ 1348 | "discard", 1349 | "rustc_version", 1350 | "stdweb-derive", 1351 | "stdweb-internal-macros", 1352 | "stdweb-internal-runtime", 1353 | "wasm-bindgen", 1354 | ] 1355 | 1356 | [[package]] 1357 | name = "stdweb-derive" 1358 | version = "0.5.3" 1359 | source = "registry+https://github.com/rust-lang/crates.io-index" 1360 | checksum = "c87a60a40fccc84bef0652345bbbbbe20a605bf5d0ce81719fc476f5c03b50ef" 1361 | dependencies = [ 1362 | "proc-macro2", 1363 | "quote", 1364 | "serde", 1365 | "serde_derive", 1366 | "syn", 1367 | ] 1368 | 1369 | [[package]] 1370 | name = "stdweb-internal-macros" 1371 | version = "0.2.9" 1372 | source = "registry+https://github.com/rust-lang/crates.io-index" 1373 | checksum = "58fa5ff6ad0d98d1ffa8cb115892b6e69d67799f6763e162a1c9db421dc22e11" 1374 | dependencies = [ 1375 | "base-x", 1376 | "proc-macro2", 1377 | "quote", 1378 | "serde", 1379 | "serde_derive", 1380 | "serde_json", 1381 | "sha1", 1382 | "syn", 1383 | ] 1384 | 1385 | [[package]] 1386 | name = "stdweb-internal-runtime" 1387 | version = "0.1.5" 1388 | source = "registry+https://github.com/rust-lang/crates.io-index" 1389 | checksum = "213701ba3370744dcd1a12960caa4843b3d68b4d1c0a5d575e0d65b2ee9d16c0" 1390 | 1391 | [[package]] 1392 | name = "strsim" 1393 | version = "0.8.0" 1394 | source = "registry+https://github.com/rust-lang/crates.io-index" 1395 | checksum = "8ea5119cdb4c55b55d432abb513a0429384878c15dde60cc77b1c99de1a95a6a" 1396 | 1397 | [[package]] 1398 | name = "structopt" 1399 | version = "0.3.26" 1400 | source = "registry+https://github.com/rust-lang/crates.io-index" 1401 | checksum = "0c6b5c64445ba8094a6ab0c3cd2ad323e07171012d9c98b0b15651daf1787a10" 1402 | dependencies = [ 1403 | "clap", 1404 | "lazy_static", 1405 | "structopt-derive", 1406 | ] 1407 | 1408 | [[package]] 1409 | name = "structopt-derive" 1410 | version = "0.4.18" 1411 | source = "registry+https://github.com/rust-lang/crates.io-index" 1412 | checksum = "dcb5ae327f9cc13b68763b5749770cb9e048a99bd9dfdfa58d0cf05d5f64afe0" 1413 | dependencies = [ 1414 | "heck", 1415 | "proc-macro-error", 1416 | "proc-macro2", 1417 | "quote", 1418 | "syn", 1419 | ] 1420 | 1421 | [[package]] 1422 | name = "subtle" 1423 | version = "2.4.1" 1424 | source = "registry+https://github.com/rust-lang/crates.io-index" 1425 | checksum = "6bdef32e8150c2a081110b42772ffe7d7c9032b606bc226c8260fd97e0976601" 1426 | 1427 | [[package]] 1428 | name = "sval" 1429 | version = "1.0.0-alpha.5" 1430 | source = "registry+https://github.com/rust-lang/crates.io-index" 1431 | checksum = "45f6ee7c7b87caf59549e9fe45d6a69c75c8019e79e212a835c5da0e92f0ba08" 1432 | 1433 | [[package]] 1434 | name = "syn" 1435 | version = "1.0.86" 1436 | source = "registry+https://github.com/rust-lang/crates.io-index" 1437 | checksum = "8a65b3f4ffa0092e9887669db0eae07941f023991ab58ea44da8fe8e2d511c6b" 1438 | dependencies = [ 1439 | "proc-macro2", 1440 | "quote", 1441 | "unicode-xid", 1442 | ] 1443 | 1444 | [[package]] 1445 | name = "textwrap" 1446 | version = "0.11.0" 1447 | source = "registry+https://github.com/rust-lang/crates.io-index" 1448 | checksum = "d326610f408c7a4eb6f51c37c330e496b08506c9457c9d34287ecc38809fb060" 1449 | dependencies = [ 1450 | "unicode-width", 1451 | ] 1452 | 1453 | [[package]] 1454 | name = "thiserror" 1455 | version = "1.0.30" 1456 | source = "registry+https://github.com/rust-lang/crates.io-index" 1457 | checksum = "854babe52e4df1653706b98fcfc05843010039b406875930a70e4d9644e5c417" 1458 | dependencies = [ 1459 | "thiserror-impl", 1460 | ] 1461 | 1462 | [[package]] 1463 | name = "thiserror-impl" 1464 | version = "1.0.30" 1465 | source = "registry+https://github.com/rust-lang/crates.io-index" 1466 | checksum = "aa32fd3f627f367fe16f893e2597ae3c05020f8bba2666a4e6ea73d377e5714b" 1467 | dependencies = [ 1468 | "proc-macro2", 1469 | "quote", 1470 | "syn", 1471 | ] 1472 | 1473 | [[package]] 1474 | name = "tide" 1475 | version = "0.16.0" 1476 | source = "registry+https://github.com/rust-lang/crates.io-index" 1477 | checksum = "c459573f0dd2cc734b539047f57489ea875af8ee950860ded20cf93a79a1dee0" 1478 | dependencies = [ 1479 | "async-h1", 1480 | "async-session", 1481 | "async-sse", 1482 | "async-std", 1483 | "async-trait", 1484 | "femme", 1485 | "futures-util", 1486 | "http-client", 1487 | "http-types", 1488 | "kv-log-macro", 1489 | "log", 1490 | "pin-project-lite 0.2.8", 1491 | "route-recognizer", 1492 | "serde", 1493 | "serde_json", 1494 | ] 1495 | 1496 | [[package]] 1497 | name = "time" 1498 | version = "0.1.44" 1499 | source = "registry+https://github.com/rust-lang/crates.io-index" 1500 | checksum = "6db9e6914ab8b1ae1c260a4ae7a49b6c5611b40328a735b21862567685e73255" 1501 | dependencies = [ 1502 | "libc", 1503 | "wasi 0.10.0+wasi-snapshot-preview1", 1504 | "winapi", 1505 | ] 1506 | 1507 | [[package]] 1508 | name = "time" 1509 | version = "0.2.27" 1510 | source = "registry+https://github.com/rust-lang/crates.io-index" 1511 | checksum = "4752a97f8eebd6854ff91f1c1824cd6160626ac4bd44287f7f4ea2035a02a242" 1512 | dependencies = [ 1513 | "const_fn", 1514 | "libc", 1515 | "standback", 1516 | "stdweb", 1517 | "time-macros", 1518 | "version_check", 1519 | "winapi", 1520 | ] 1521 | 1522 | [[package]] 1523 | name = "time-macros" 1524 | version = "0.1.1" 1525 | source = "registry+https://github.com/rust-lang/crates.io-index" 1526 | checksum = "957e9c6e26f12cb6d0dd7fc776bb67a706312e7299aed74c8dd5b17ebb27e2f1" 1527 | dependencies = [ 1528 | "proc-macro-hack", 1529 | "time-macros-impl", 1530 | ] 1531 | 1532 | [[package]] 1533 | name = "time-macros-impl" 1534 | version = "0.1.2" 1535 | source = "registry+https://github.com/rust-lang/crates.io-index" 1536 | checksum = "fd3c141a1b43194f3f56a1411225df8646c55781d5f26db825b3d98507eb482f" 1537 | dependencies = [ 1538 | "proc-macro-hack", 1539 | "proc-macro2", 1540 | "quote", 1541 | "standback", 1542 | "syn", 1543 | ] 1544 | 1545 | [[package]] 1546 | name = "tinyvec" 1547 | version = "1.5.1" 1548 | source = "registry+https://github.com/rust-lang/crates.io-index" 1549 | checksum = "2c1c1d5a42b6245520c249549ec267180beaffcc0615401ac8e31853d4b6d8d2" 1550 | dependencies = [ 1551 | "tinyvec_macros", 1552 | ] 1553 | 1554 | [[package]] 1555 | name = "tinyvec_macros" 1556 | version = "0.1.0" 1557 | source = "registry+https://github.com/rust-lang/crates.io-index" 1558 | checksum = "cda74da7e1a664f795bb1f8a87ec406fb89a02522cf6e50620d016add6dbbf5c" 1559 | 1560 | [[package]] 1561 | name = "typenum" 1562 | version = "1.15.0" 1563 | source = "registry+https://github.com/rust-lang/crates.io-index" 1564 | checksum = "dcf81ac59edc17cc8697ff311e8f5ef2d99fcbd9817b34cec66f90b6c3dfd987" 1565 | 1566 | [[package]] 1567 | name = "unicode-bidi" 1568 | version = "0.3.7" 1569 | source = "registry+https://github.com/rust-lang/crates.io-index" 1570 | checksum = "1a01404663e3db436ed2746d9fefef640d868edae3cceb81c3b8d5732fda678f" 1571 | 1572 | [[package]] 1573 | name = "unicode-normalization" 1574 | version = "0.1.19" 1575 | source = "registry+https://github.com/rust-lang/crates.io-index" 1576 | checksum = "d54590932941a9e9266f0832deed84ebe1bf2e4c9e4a3554d393d18f5e854bf9" 1577 | dependencies = [ 1578 | "tinyvec", 1579 | ] 1580 | 1581 | [[package]] 1582 | name = "unicode-segmentation" 1583 | version = "1.9.0" 1584 | source = "registry+https://github.com/rust-lang/crates.io-index" 1585 | checksum = "7e8820f5d777f6224dc4be3632222971ac30164d4a258d595640799554ebfd99" 1586 | 1587 | [[package]] 1588 | name = "unicode-width" 1589 | version = "0.1.9" 1590 | source = "registry+https://github.com/rust-lang/crates.io-index" 1591 | checksum = "3ed742d4ea2bd1176e236172c8429aaf54486e7ac098db29ffe6529e0ce50973" 1592 | 1593 | [[package]] 1594 | name = "unicode-xid" 1595 | version = "0.2.2" 1596 | source = "registry+https://github.com/rust-lang/crates.io-index" 1597 | checksum = "8ccb82d61f80a663efe1f787a51b16b5a51e3314d6ac365b08639f52387b33f3" 1598 | 1599 | [[package]] 1600 | name = "universal-hash" 1601 | version = "0.4.1" 1602 | source = "registry+https://github.com/rust-lang/crates.io-index" 1603 | checksum = "9f214e8f697e925001e66ec2c6e37a4ef93f0f78c2eed7814394e10c62025b05" 1604 | dependencies = [ 1605 | "generic-array", 1606 | "subtle", 1607 | ] 1608 | 1609 | [[package]] 1610 | name = "url" 1611 | version = "2.2.2" 1612 | source = "registry+https://github.com/rust-lang/crates.io-index" 1613 | checksum = "a507c383b2d33b5fc35d1861e77e6b383d158b2da5e14fe51b83dfedf6fd578c" 1614 | dependencies = [ 1615 | "form_urlencoded", 1616 | "idna", 1617 | "matches", 1618 | "percent-encoding", 1619 | "serde", 1620 | ] 1621 | 1622 | [[package]] 1623 | name = "value-bag" 1624 | version = "1.0.0-alpha.8" 1625 | source = "registry+https://github.com/rust-lang/crates.io-index" 1626 | checksum = "79923f7731dc61ebfba3633098bf3ac533bbd35ccd8c57e7088d9a5eebe0263f" 1627 | dependencies = [ 1628 | "ctor", 1629 | "sval", 1630 | "version_check", 1631 | ] 1632 | 1633 | [[package]] 1634 | name = "vec_map" 1635 | version = "0.8.2" 1636 | source = "registry+https://github.com/rust-lang/crates.io-index" 1637 | checksum = "f1bddf1187be692e79c5ffeab891132dfb0f236ed36a43c7ed39f1165ee20191" 1638 | 1639 | [[package]] 1640 | name = "version_check" 1641 | version = "0.9.4" 1642 | source = "registry+https://github.com/rust-lang/crates.io-index" 1643 | checksum = "49874b5167b65d7193b8aba1567f5c7d93d001cafc34600cee003eda787e483f" 1644 | 1645 | [[package]] 1646 | name = "waker-fn" 1647 | version = "1.1.0" 1648 | source = "registry+https://github.com/rust-lang/crates.io-index" 1649 | checksum = "9d5b2c62b4012a3e1eca5a7e077d13b3bf498c4073e33ccd58626607748ceeca" 1650 | 1651 | [[package]] 1652 | name = "wasi" 1653 | version = "0.9.0+wasi-snapshot-preview1" 1654 | source = "registry+https://github.com/rust-lang/crates.io-index" 1655 | checksum = "cccddf32554fecc6acb585f82a32a72e28b48f8c4c1883ddfeeeaa96f7d8e519" 1656 | 1657 | [[package]] 1658 | name = "wasi" 1659 | version = "0.10.0+wasi-snapshot-preview1" 1660 | source = "registry+https://github.com/rust-lang/crates.io-index" 1661 | checksum = "1a143597ca7c7793eff794def352d41792a93c481eb1042423ff7ff72ba2c31f" 1662 | 1663 | [[package]] 1664 | name = "wasm-bindgen" 1665 | version = "0.2.79" 1666 | source = "registry+https://github.com/rust-lang/crates.io-index" 1667 | checksum = "25f1af7423d8588a3d840681122e72e6a24ddbcb3f0ec385cac0d12d24256c06" 1668 | dependencies = [ 1669 | "cfg-if 1.0.0", 1670 | "serde", 1671 | "serde_json", 1672 | "wasm-bindgen-macro", 1673 | ] 1674 | 1675 | [[package]] 1676 | name = "wasm-bindgen-backend" 1677 | version = "0.2.79" 1678 | source = "registry+https://github.com/rust-lang/crates.io-index" 1679 | checksum = "8b21c0df030f5a177f3cba22e9bc4322695ec43e7257d865302900290bcdedca" 1680 | dependencies = [ 1681 | "bumpalo", 1682 | "lazy_static", 1683 | "log", 1684 | "proc-macro2", 1685 | "quote", 1686 | "syn", 1687 | "wasm-bindgen-shared", 1688 | ] 1689 | 1690 | [[package]] 1691 | name = "wasm-bindgen-futures" 1692 | version = "0.4.29" 1693 | source = "registry+https://github.com/rust-lang/crates.io-index" 1694 | checksum = "2eb6ec270a31b1d3c7e266b999739109abce8b6c87e4b31fcfcd788b65267395" 1695 | dependencies = [ 1696 | "cfg-if 1.0.0", 1697 | "js-sys", 1698 | "wasm-bindgen", 1699 | "web-sys", 1700 | ] 1701 | 1702 | [[package]] 1703 | name = "wasm-bindgen-macro" 1704 | version = "0.2.79" 1705 | source = "registry+https://github.com/rust-lang/crates.io-index" 1706 | checksum = "2f4203d69e40a52ee523b2529a773d5ffc1dc0071801c87b3d270b471b80ed01" 1707 | dependencies = [ 1708 | "quote", 1709 | "wasm-bindgen-macro-support", 1710 | ] 1711 | 1712 | [[package]] 1713 | name = "wasm-bindgen-macro-support" 1714 | version = "0.2.79" 1715 | source = "registry+https://github.com/rust-lang/crates.io-index" 1716 | checksum = "bfa8a30d46208db204854cadbb5d4baf5fcf8071ba5bf48190c3e59937962ebc" 1717 | dependencies = [ 1718 | "proc-macro2", 1719 | "quote", 1720 | "syn", 1721 | "wasm-bindgen-backend", 1722 | "wasm-bindgen-shared", 1723 | ] 1724 | 1725 | [[package]] 1726 | name = "wasm-bindgen-shared" 1727 | version = "0.2.79" 1728 | source = "registry+https://github.com/rust-lang/crates.io-index" 1729 | checksum = "3d958d035c4438e28c70e4321a2911302f10135ce78a9c7834c0cab4123d06a2" 1730 | 1731 | [[package]] 1732 | name = "web-sys" 1733 | version = "0.3.56" 1734 | source = "registry+https://github.com/rust-lang/crates.io-index" 1735 | checksum = "c060b319f29dd25724f09a2ba1418f142f539b2be99fbf4d2d5a8f7330afb8eb" 1736 | dependencies = [ 1737 | "js-sys", 1738 | "wasm-bindgen", 1739 | ] 1740 | 1741 | [[package]] 1742 | name = "wepoll-ffi" 1743 | version = "0.1.2" 1744 | source = "registry+https://github.com/rust-lang/crates.io-index" 1745 | checksum = "d743fdedc5c64377b5fc2bc036b01c7fd642205a0d96356034ae3404d49eb7fb" 1746 | dependencies = [ 1747 | "cc", 1748 | ] 1749 | 1750 | [[package]] 1751 | name = "winapi" 1752 | version = "0.3.9" 1753 | source = "registry+https://github.com/rust-lang/crates.io-index" 1754 | checksum = "5c839a674fcd7a98952e593242ea400abe93992746761e38641405d28b00f419" 1755 | dependencies = [ 1756 | "winapi-i686-pc-windows-gnu", 1757 | "winapi-x86_64-pc-windows-gnu", 1758 | ] 1759 | 1760 | [[package]] 1761 | name = "winapi-i686-pc-windows-gnu" 1762 | version = "0.4.0" 1763 | source = "registry+https://github.com/rust-lang/crates.io-index" 1764 | checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" 1765 | 1766 | [[package]] 1767 | name = "winapi-x86_64-pc-windows-gnu" 1768 | version = "0.4.0" 1769 | source = "registry+https://github.com/rust-lang/crates.io-index" 1770 | checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" 1771 | -------------------------------------------------------------------------------- /Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "rust-web-boilerplate" 3 | version = "0.1.0" 4 | authors = ["pbzweihander "] 5 | edition = "2018" 6 | 7 | [dependencies] 8 | async-std = { version = "1.10.0", features = ["attributes"] } 9 | structopt = "0.3.26" 10 | tide = "0.16.0" 11 | -------------------------------------------------------------------------------- /Dockerfile: -------------------------------------------------------------------------------- 1 | FROM clux/muslrust:1.50.0-stable 2 | 3 | WORKDIR /app 4 | 5 | COPY ./Cargo.toml ./Cargo.toml 6 | COPY ./Cargo.lock ./Cargo.lock 7 | COPY ./src ./src 8 | 9 | RUN cargo build --release 10 | 11 | FROM alpine:latest 12 | 13 | RUN apk --no-cache add tini 14 | ENTRYPOINT ["/sbin/tini", "--"] 15 | 16 | COPY --from=0 \ 17 | /app/target/x86_64-unknown-linux-musl/release/rust-web-boilerplate \ 18 | /usr/bin/rust-web-boilerplate 19 | 20 | EXPOSE 5000 21 | 22 | CMD ["/usr/bin/rust-web-boilerplate", "-p", "5000"] 23 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) 2019 pbzweihander 2 | 3 | Permission is hereby granted, free of charge, to any 4 | person obtaining a copy of this software and associated 5 | documentation files (the "Software"), to deal in the 6 | Software without restriction, including without 7 | limitation the rights to use, copy, modify, merge, 8 | publish, distribute, sublicense, and/or sell copies of 9 | the Software, and to permit persons to whom the Software 10 | is furnished to do so, subject to the following 11 | conditions: 12 | 13 | The above copyright notice and this permission notice 14 | shall be included in all copies or substantial portions 15 | of the Software. 16 | 17 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF 18 | ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED 19 | TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A 20 | PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT 21 | SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY 22 | CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION 23 | OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR 24 | IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 25 | DEALINGS IN THE SOFTWARE. 26 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # rust-web-boilerplate 2 | 3 | [![CircleCI Badge]][CircleCI] 4 | [![MIT License Badge]][MIT License] 5 | 6 | Are we web yet? Yes, almost! A boilerplate for working web server with Rust. 7 | 8 | ## Usage 9 | 10 | Cool help messages from [structopt]. 11 | 12 | ```bash 13 | $ cargo run -- --help 14 | rust-web-boilerplate 0.1.0 15 | pbzweihander 16 | 17 | USAGE: 18 | rust-web-boilerplate [OPTIONS] 19 | 20 | FLAGS: 21 | --help Prints help information 22 | -V, --version Prints version information 23 | 24 | OPTIONS: 25 | -h, --host [default: 0.0.0.0] 26 | -p, --port [default: 5000] 27 | 28 | $ cargo run -- -h localhost -p 8080 29 | Server is listening on: http://[::1]:8080 30 | 31 | # On another terminal... 32 | $ curl localhost:8080/ping 33 | OK 34 | 35 | $ curl localhost:8080/hello/rustacean 36 | Hello, rustacean! 37 | 38 | $ curl -d "I love Rust" localhost:8080/hello/ferris 39 | Hello, ferris! 40 | Your message was "I love Rust". 41 | ``` 42 | 43 | ## Test 44 | 45 | Check out [the test code][integration test code]. 46 | 47 | ```bash 48 | cargo test 49 | ``` 50 | 51 | --- 52 | 53 | _rust-web-boilerplate_ is distributed under the terms of the [MIT License] 54 | 55 | 56 | [CircleCI Badge]: https://circleci.com/gh/pbzweihander/rust-web-boilerplate.svg?style=svg 57 | [CircleCI]: https://circleci.com/gh/pbzweihander/rust-web-boilerplate 58 | [MIT License Badge]: https://badgen.net/badge/license/MIT/blue 59 | [MIT License]: LICENSE 60 | [tide]: https://github.com/rustasync/tide 61 | [futures 0.3]: https://github.com/rust-lang-nursery/futures-rs 62 | [structopt]: https://github.com/TeXitoi/structopt 63 | [http-service-mock]: https://github.com/rustasync/http-service 64 | [integration test code]: tests/integration.rs 65 | -------------------------------------------------------------------------------- /src/api.rs: -------------------------------------------------------------------------------- 1 | use { 2 | crate::config::Config, 3 | tide::{Request, Result}, 4 | }; 5 | 6 | pub async fn hello(req: Request) -> Result { 7 | let name = req.param("name")?; 8 | 9 | Ok(format!("Hello, {}!", name).into()) 10 | } 11 | 12 | pub async fn hello_with_body(mut req: Request) -> Result { 13 | let name = req.param("name")?.to_owned(); 14 | let msg = req.body_string().await?; 15 | 16 | Ok(format!("Hello, {}!\nYour message was \"{}\".", name, msg).into()) 17 | } 18 | -------------------------------------------------------------------------------- /src/config.rs: -------------------------------------------------------------------------------- 1 | use structopt::StructOpt; 2 | 3 | #[derive(Debug, Clone, StructOpt)] 4 | pub struct Config { 5 | #[structopt(short, long, default_value = "0.0.0.0")] 6 | pub host: String, 7 | #[structopt(short, long, default_value = "5000")] 8 | pub port: u16, 9 | } 10 | 11 | impl Config { 12 | pub fn from_args() -> Self { 13 | StructOpt::from_args() 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /src/lib.rs: -------------------------------------------------------------------------------- 1 | mod api; 2 | pub mod config; 3 | 4 | use {crate::config::Config, tide::Server}; 5 | 6 | pub fn make_server(config: Config) -> Server { 7 | let mut app = tide::with_state(config); 8 | app.at("/ping").get(|_| async { Ok("OK") }); 9 | app.at("/hello/:name") 10 | .get(api::hello) 11 | .post(api::hello_with_body); 12 | 13 | app 14 | } 15 | -------------------------------------------------------------------------------- /src/main.rs: -------------------------------------------------------------------------------- 1 | use rust_web_boilerplate::{config::Config, make_server}; 2 | 3 | #[async_std::main] 4 | async fn main() -> Result<(), std::io::Error> { 5 | let config = Config::from_args(); 6 | let (host, port) = (config.host.clone(), config.port); 7 | 8 | let server = make_server(config); 9 | 10 | server.listen((host, port)).await?; 11 | 12 | Ok(()) 13 | } 14 | -------------------------------------------------------------------------------- /tests/integration.rs: -------------------------------------------------------------------------------- 1 | use { 2 | rust_web_boilerplate::{config::Config, make_server}, 3 | tide::http::{Body, Request, Response, Url}, 4 | }; 5 | 6 | #[async_std::test] 7 | async fn test_not_found() { 8 | let server = make_server(Config { 9 | host: "0.0.0.0".to_string(), 10 | port: 5000, 11 | }); 12 | 13 | let mut req = Request::get(Url::parse("http://localhost:5000/foobar").unwrap()); 14 | req.set_body(Body::empty()); 15 | let resp: Response = server.respond(req).await.unwrap(); 16 | assert_eq!(resp.status(), 404); 17 | } 18 | 19 | #[async_std::test] 20 | async fn test_ping() { 21 | let server = make_server(Config { 22 | host: "0.0.0.0".to_string(), 23 | port: 5000, 24 | }); 25 | 26 | let mut req = Request::get(Url::parse("http://localhost:5000/ping").unwrap()); 27 | req.set_body(Body::empty()); 28 | let mut resp: Response = server.respond(req).await.unwrap(); 29 | assert_eq!(resp.status(), 200); 30 | let body = resp.body_string().await.unwrap(); 31 | assert_eq!(&body, "OK"); 32 | } 33 | 34 | #[async_std::test] 35 | async fn test_hello() { 36 | let server = make_server(Config { 37 | host: "0.0.0.0".to_string(), 38 | port: 5000, 39 | }); 40 | 41 | let mut req = Request::get(Url::parse("http://localhost:5000/hello/foobar").unwrap()); 42 | req.set_body(Body::empty()); 43 | let mut resp: Response = server.respond(req).await.unwrap(); 44 | assert_eq!(resp.status(), 200); 45 | let body = resp.body_string().await.unwrap(); 46 | assert_eq!(&body, "Hello, foobar!"); 47 | } 48 | 49 | #[async_std::test] 50 | async fn test_hello_with_body() { 51 | let server = make_server(Config { 52 | host: "0.0.0.0".to_string(), 53 | port: 5000, 54 | }); 55 | 56 | let mut req = Request::post(Url::parse("http://localhost:5000/hello/foobar").unwrap()); 57 | req.set_body("baz"); 58 | let mut resp: Response = server.respond(req).await.unwrap(); 59 | assert_eq!(resp.status(), 200); 60 | let body = resp.body_string().await.unwrap(); 61 | assert_eq!(&body, "Hello, foobar!\nYour message was \"baz\"."); 62 | } 63 | -------------------------------------------------------------------------------- /tools/pre-commit: -------------------------------------------------------------------------------- 1 | #!/bin/bash -e 2 | cargo fmt -- --check --verbose 3 | -------------------------------------------------------------------------------- /tools/pre-push: -------------------------------------------------------------------------------- 1 | #!/bin/bash -e 2 | cargo fmt -- --check --verbose 3 | cargo clippy --all-targets 4 | cargo test 5 | --------------------------------------------------------------------------------