Your one-stop-cake-shop for everything Freshly Baked has to offer

feat(m): add project start

We're going to need some routes to fallback to when we hit a URL that
doesn't yet exist. I've added some basic ones - which means we can
deploy this project as soon as it's packaged, as even if it's not
really ready to use yet, switching your search engine to it won't cause
problems

a.starrysky.fyi 07479f5a 49d9d794

verified
+11
menu/.gitignore
··· 1 + # SPDX-FileCopyrightText: 2026 Freshly Baked Cake 2 + # 3 + # SPDX-License-Identifier: CC0-1.0 4 + 1 5 /target 6 + 7 + 8 + # Added by cargo 9 + # 10 + # already existing elements were commented out 11 + 12 + #/target
+594
menu/Cargo.lock
··· 1 + # This file is automatically @generated by Cargo. 2 + # It is not intended for manual editing. 3 + version = 4 4 + 5 + [[package]] 6 + name = "atomic-waker" 7 + version = "1.1.2" 8 + source = "registry+https://github.com/rust-lang/crates.io-index" 9 + checksum = "1505bd5d3d116872e7271a6d4e16d81d0c8570876c8de68093a09ac269d8aac0" 10 + 11 + [[package]] 12 + name = "axum" 13 + version = "0.8.8" 14 + source = "registry+https://github.com/rust-lang/crates.io-index" 15 + checksum = "8b52af3cb4058c895d37317bb27508dccc8e5f2d39454016b297bf4a400597b8" 16 + dependencies = [ 17 + "axum-core", 18 + "bytes", 19 + "form_urlencoded", 20 + "futures-util", 21 + "http", 22 + "http-body", 23 + "http-body-util", 24 + "hyper", 25 + "hyper-util", 26 + "itoa", 27 + "matchit", 28 + "memchr", 29 + "mime", 30 + "percent-encoding", 31 + "pin-project-lite", 32 + "serde_core", 33 + "serde_json", 34 + "serde_path_to_error", 35 + "serde_urlencoded", 36 + "sync_wrapper", 37 + "tokio", 38 + "tower", 39 + "tower-layer", 40 + "tower-service", 41 + "tracing", 42 + ] 43 + 44 + [[package]] 45 + name = "axum-core" 46 + version = "0.5.6" 47 + source = "registry+https://github.com/rust-lang/crates.io-index" 48 + checksum = "08c78f31d7b1291f7ee735c1c6780ccde7785daae9a9206026862dab7d8792d1" 49 + dependencies = [ 50 + "bytes", 51 + "futures-core", 52 + "http", 53 + "http-body", 54 + "http-body-util", 55 + "mime", 56 + "pin-project-lite", 57 + "sync_wrapper", 58 + "tower-layer", 59 + "tower-service", 60 + "tracing", 61 + ] 62 + 63 + [[package]] 64 + name = "bitflags" 65 + version = "2.10.0" 66 + source = "registry+https://github.com/rust-lang/crates.io-index" 67 + checksum = "812e12b5285cc515a9c72a5c1d3b6d46a19dac5acfef5265968c166106e31dd3" 68 + 69 + [[package]] 70 + name = "bytes" 71 + version = "1.11.0" 72 + source = "registry+https://github.com/rust-lang/crates.io-index" 73 + checksum = "b35204fbdc0b3f4446b89fc1ac2cf84a8a68971995d0bf2e925ec7cd960f9cb3" 74 + 75 + [[package]] 76 + name = "form_urlencoded" 77 + version = "1.2.2" 78 + source = "registry+https://github.com/rust-lang/crates.io-index" 79 + checksum = "cb4cb245038516f5f85277875cdaa4f7d2c9a0fa0468de06ed190163b1581fcf" 80 + dependencies = [ 81 + "percent-encoding", 82 + ] 83 + 84 + [[package]] 85 + name = "futures-channel" 86 + version = "0.3.31" 87 + source = "registry+https://github.com/rust-lang/crates.io-index" 88 + checksum = "2dff15bf788c671c1934e366d07e30c1814a8ef514e1af724a602e8a2fbe1b10" 89 + dependencies = [ 90 + "futures-core", 91 + ] 92 + 93 + [[package]] 94 + name = "futures-core" 95 + version = "0.3.31" 96 + source = "registry+https://github.com/rust-lang/crates.io-index" 97 + checksum = "05f29059c0c2090612e8d742178b0580d2dc940c837851ad723096f87af6663e" 98 + 99 + [[package]] 100 + name = "futures-task" 101 + version = "0.3.31" 102 + source = "registry+https://github.com/rust-lang/crates.io-index" 103 + checksum = "f90f7dce0722e95104fcb095585910c0977252f286e354b5e3bd38902cd99988" 104 + 105 + [[package]] 106 + name = "futures-util" 107 + version = "0.3.31" 108 + source = "registry+https://github.com/rust-lang/crates.io-index" 109 + checksum = "9fa08315bb612088cc391249efdc3bc77536f16c91f6cf495e6fbe85b20a4a81" 110 + dependencies = [ 111 + "futures-core", 112 + "futures-task", 113 + "pin-project-lite", 114 + "pin-utils", 115 + ] 116 + 117 + [[package]] 118 + name = "http" 119 + version = "1.4.0" 120 + source = "registry+https://github.com/rust-lang/crates.io-index" 121 + checksum = "e3ba2a386d7f85a81f119ad7498ebe444d2e22c2af0b86b069416ace48b3311a" 122 + dependencies = [ 123 + "bytes", 124 + "itoa", 125 + ] 126 + 127 + [[package]] 128 + name = "http-body" 129 + version = "1.0.1" 130 + source = "registry+https://github.com/rust-lang/crates.io-index" 131 + checksum = "1efedce1fb8e6913f23e0c92de8e62cd5b772a67e7b3946df930a62566c93184" 132 + dependencies = [ 133 + "bytes", 134 + "http", 135 + ] 136 + 137 + [[package]] 138 + name = "http-body-util" 139 + version = "0.1.3" 140 + source = "registry+https://github.com/rust-lang/crates.io-index" 141 + checksum = "b021d93e26becf5dc7e1b75b1bed1fd93124b374ceb73f43d4d4eafec896a64a" 142 + dependencies = [ 143 + "bytes", 144 + "futures-core", 145 + "http", 146 + "http-body", 147 + "pin-project-lite", 148 + ] 149 + 150 + [[package]] 151 + name = "httparse" 152 + version = "1.10.1" 153 + source = "registry+https://github.com/rust-lang/crates.io-index" 154 + checksum = "6dbf3de79e51f3d586ab4cb9d5c3e2c14aa28ed23d180cf89b4df0454a69cc87" 155 + 156 + [[package]] 157 + name = "httpdate" 158 + version = "1.0.3" 159 + source = "registry+https://github.com/rust-lang/crates.io-index" 160 + checksum = "df3b46402a9d5adb4c86a0cf463f42e19994e3ee891101b1841f30a545cb49a9" 161 + 162 + [[package]] 163 + name = "hyper" 164 + version = "1.8.1" 165 + source = "registry+https://github.com/rust-lang/crates.io-index" 166 + checksum = "2ab2d4f250c3d7b1c9fcdff1cece94ea4e2dfbec68614f7b87cb205f24ca9d11" 167 + dependencies = [ 168 + "atomic-waker", 169 + "bytes", 170 + "futures-channel", 171 + "futures-core", 172 + "http", 173 + "http-body", 174 + "httparse", 175 + "httpdate", 176 + "itoa", 177 + "pin-project-lite", 178 + "pin-utils", 179 + "smallvec", 180 + "tokio", 181 + ] 182 + 183 + [[package]] 184 + name = "hyper-util" 185 + version = "0.1.19" 186 + source = "registry+https://github.com/rust-lang/crates.io-index" 187 + checksum = "727805d60e7938b76b826a6ef209eb70eaa1812794f9424d4a4e2d740662df5f" 188 + dependencies = [ 189 + "bytes", 190 + "futures-core", 191 + "http", 192 + "http-body", 193 + "hyper", 194 + "pin-project-lite", 195 + "tokio", 196 + "tower-service", 197 + ] 198 + 199 + [[package]] 200 + name = "itoa" 201 + version = "1.0.17" 202 + source = "registry+https://github.com/rust-lang/crates.io-index" 203 + checksum = "92ecc6618181def0457392ccd0ee51198e065e016d1d527a7ac1b6dc7c1f09d2" 204 + 205 + [[package]] 206 + name = "libc" 207 + version = "0.2.179" 208 + source = "registry+https://github.com/rust-lang/crates.io-index" 209 + checksum = "c5a2d376baa530d1238d133232d15e239abad80d05838b4b59354e5268af431f" 210 + 211 + [[package]] 212 + name = "log" 213 + version = "0.4.29" 214 + source = "registry+https://github.com/rust-lang/crates.io-index" 215 + checksum = "5e5032e24019045c762d3c0f28f5b6b8bbf38563a65908389bf7978758920897" 216 + 217 + [[package]] 218 + name = "matchit" 219 + version = "0.8.4" 220 + source = "registry+https://github.com/rust-lang/crates.io-index" 221 + checksum = "47e1ffaa40ddd1f3ed91f717a33c8c0ee23fff369e3aa8772b9605cc1d22f4c3" 222 + 223 + [[package]] 224 + name = "memchr" 225 + version = "2.7.6" 226 + source = "registry+https://github.com/rust-lang/crates.io-index" 227 + checksum = "f52b00d39961fc5b2736ea853c9cc86238e165017a493d1d5c8eac6bdc4cc273" 228 + 229 + [[package]] 230 + name = "menu" 231 + version = "0.1.0" 232 + dependencies = [ 233 + "axum", 234 + "tokio", 235 + "tower-http", 236 + "tower-layer", 237 + ] 238 + 239 + [[package]] 240 + name = "mime" 241 + version = "0.3.17" 242 + source = "registry+https://github.com/rust-lang/crates.io-index" 243 + checksum = "6877bb514081ee2a7ff5ef9de3281f14a4dd4bceac4c09388074a6b5df8a139a" 244 + 245 + [[package]] 246 + name = "mio" 247 + version = "1.1.1" 248 + source = "registry+https://github.com/rust-lang/crates.io-index" 249 + checksum = "a69bcab0ad47271a0234d9422b131806bf3968021e5dc9328caf2d4cd58557fc" 250 + dependencies = [ 251 + "libc", 252 + "wasi", 253 + "windows-sys 0.61.2", 254 + ] 255 + 256 + [[package]] 257 + name = "once_cell" 258 + version = "1.21.3" 259 + source = "registry+https://github.com/rust-lang/crates.io-index" 260 + checksum = "42f5e15c9953c5e4ccceeb2e7382a716482c34515315f7b03532b8b4e8393d2d" 261 + 262 + [[package]] 263 + name = "percent-encoding" 264 + version = "2.3.2" 265 + source = "registry+https://github.com/rust-lang/crates.io-index" 266 + checksum = "9b4f627cb1b25917193a259e49bdad08f671f8d9708acfd5fe0a8c1455d87220" 267 + 268 + [[package]] 269 + name = "pin-project-lite" 270 + version = "0.2.16" 271 + source = "registry+https://github.com/rust-lang/crates.io-index" 272 + checksum = "3b3cff922bd51709b605d9ead9aa71031d81447142d828eb4a6eba76fe619f9b" 273 + 274 + [[package]] 275 + name = "pin-utils" 276 + version = "0.1.0" 277 + source = "registry+https://github.com/rust-lang/crates.io-index" 278 + checksum = "8b870d8c151b6f2fb93e84a13146138f05d02ed11c7e7c54f8826aaaf7c9f184" 279 + 280 + [[package]] 281 + name = "proc-macro2" 282 + version = "1.0.104" 283 + source = "registry+https://github.com/rust-lang/crates.io-index" 284 + checksum = "9695f8df41bb4f3d222c95a67532365f569318332d03d5f3f67f37b20e6ebdf0" 285 + dependencies = [ 286 + "unicode-ident", 287 + ] 288 + 289 + [[package]] 290 + name = "quote" 291 + version = "1.0.42" 292 + source = "registry+https://github.com/rust-lang/crates.io-index" 293 + checksum = "a338cc41d27e6cc6dce6cefc13a0729dfbb81c262b1f519331575dd80ef3067f" 294 + dependencies = [ 295 + "proc-macro2", 296 + ] 297 + 298 + [[package]] 299 + name = "ryu" 300 + version = "1.0.22" 301 + source = "registry+https://github.com/rust-lang/crates.io-index" 302 + checksum = "a50f4cf475b65d88e057964e0e9bb1f0aa9bbb2036dc65c64596b42932536984" 303 + 304 + [[package]] 305 + name = "serde" 306 + version = "1.0.228" 307 + source = "registry+https://github.com/rust-lang/crates.io-index" 308 + checksum = "9a8e94ea7f378bd32cbbd37198a4a91436180c5bb472411e48b5ec2e2124ae9e" 309 + dependencies = [ 310 + "serde_core", 311 + ] 312 + 313 + [[package]] 314 + name = "serde_core" 315 + version = "1.0.228" 316 + source = "registry+https://github.com/rust-lang/crates.io-index" 317 + checksum = "41d385c7d4ca58e59fc732af25c3983b67ac852c1a25000afe1175de458b67ad" 318 + dependencies = [ 319 + "serde_derive", 320 + ] 321 + 322 + [[package]] 323 + name = "serde_derive" 324 + version = "1.0.228" 325 + source = "registry+https://github.com/rust-lang/crates.io-index" 326 + checksum = "d540f220d3187173da220f885ab66608367b6574e925011a9353e4badda91d79" 327 + dependencies = [ 328 + "proc-macro2", 329 + "quote", 330 + "syn", 331 + ] 332 + 333 + [[package]] 334 + name = "serde_json" 335 + version = "1.0.148" 336 + source = "registry+https://github.com/rust-lang/crates.io-index" 337 + checksum = "3084b546a1dd6289475996f182a22aba973866ea8e8b02c51d9f46b1336a22da" 338 + dependencies = [ 339 + "itoa", 340 + "memchr", 341 + "serde", 342 + "serde_core", 343 + "zmij", 344 + ] 345 + 346 + [[package]] 347 + name = "serde_path_to_error" 348 + version = "0.1.20" 349 + source = "registry+https://github.com/rust-lang/crates.io-index" 350 + checksum = "10a9ff822e371bb5403e391ecd83e182e0e77ba7f6fe0160b795797109d1b457" 351 + dependencies = [ 352 + "itoa", 353 + "serde", 354 + "serde_core", 355 + ] 356 + 357 + [[package]] 358 + name = "serde_urlencoded" 359 + version = "0.7.1" 360 + source = "registry+https://github.com/rust-lang/crates.io-index" 361 + checksum = "d3491c14715ca2294c4d6a88f15e84739788c1d030eed8c110436aafdaa2f3fd" 362 + dependencies = [ 363 + "form_urlencoded", 364 + "itoa", 365 + "ryu", 366 + "serde", 367 + ] 368 + 369 + [[package]] 370 + name = "smallvec" 371 + version = "1.15.1" 372 + source = "registry+https://github.com/rust-lang/crates.io-index" 373 + checksum = "67b1b7a3b5fe4f1376887184045fcf45c69e92af734b7aaddc05fb777b6fbd03" 374 + 375 + [[package]] 376 + name = "socket2" 377 + version = "0.6.1" 378 + source = "registry+https://github.com/rust-lang/crates.io-index" 379 + checksum = "17129e116933cf371d018bb80ae557e889637989d8638274fb25622827b03881" 380 + dependencies = [ 381 + "libc", 382 + "windows-sys 0.60.2", 383 + ] 384 + 385 + [[package]] 386 + name = "syn" 387 + version = "2.0.112" 388 + source = "registry+https://github.com/rust-lang/crates.io-index" 389 + checksum = "21f182278bf2d2bcb3c88b1b08a37df029d71ce3d3ae26168e3c653b213b99d4" 390 + dependencies = [ 391 + "proc-macro2", 392 + "quote", 393 + "unicode-ident", 394 + ] 395 + 396 + [[package]] 397 + name = "sync_wrapper" 398 + version = "1.0.2" 399 + source = "registry+https://github.com/rust-lang/crates.io-index" 400 + checksum = "0bf256ce5efdfa370213c1dabab5935a12e49f2c58d15e9eac2870d3b4f27263" 401 + 402 + [[package]] 403 + name = "tokio" 404 + version = "1.49.0" 405 + source = "registry+https://github.com/rust-lang/crates.io-index" 406 + checksum = "72a2903cd7736441aac9df9d7688bd0ce48edccaadf181c3b90be801e81d3d86" 407 + dependencies = [ 408 + "libc", 409 + "mio", 410 + "pin-project-lite", 411 + "socket2", 412 + "tokio-macros", 413 + "windows-sys 0.61.2", 414 + ] 415 + 416 + [[package]] 417 + name = "tokio-macros" 418 + version = "2.6.0" 419 + source = "registry+https://github.com/rust-lang/crates.io-index" 420 + checksum = "af407857209536a95c8e56f8231ef2c2e2aff839b22e07a1ffcbc617e9db9fa5" 421 + dependencies = [ 422 + "proc-macro2", 423 + "quote", 424 + "syn", 425 + ] 426 + 427 + [[package]] 428 + name = "tower" 429 + version = "0.5.2" 430 + source = "registry+https://github.com/rust-lang/crates.io-index" 431 + checksum = "d039ad9159c98b70ecfd540b2573b97f7f52c3e8d9f8ad57a24b916a536975f9" 432 + dependencies = [ 433 + "futures-core", 434 + "futures-util", 435 + "pin-project-lite", 436 + "sync_wrapper", 437 + "tokio", 438 + "tower-layer", 439 + "tower-service", 440 + "tracing", 441 + ] 442 + 443 + [[package]] 444 + name = "tower-http" 445 + version = "0.6.8" 446 + source = "registry+https://github.com/rust-lang/crates.io-index" 447 + checksum = "d4e6559d53cc268e5031cd8429d05415bc4cb4aefc4aa5d6cc35fbf5b924a1f8" 448 + dependencies = [ 449 + "bitflags", 450 + "bytes", 451 + "http", 452 + "pin-project-lite", 453 + "tower-layer", 454 + "tower-service", 455 + ] 456 + 457 + [[package]] 458 + name = "tower-layer" 459 + version = "0.3.3" 460 + source = "registry+https://github.com/rust-lang/crates.io-index" 461 + checksum = "121c2a6cda46980bb0fcd1647ffaf6cd3fc79a013de288782836f6df9c48780e" 462 + 463 + [[package]] 464 + name = "tower-service" 465 + version = "0.3.3" 466 + source = "registry+https://github.com/rust-lang/crates.io-index" 467 + checksum = "8df9b6e13f2d32c91b9bd719c00d1958837bc7dec474d94952798cc8e69eeec3" 468 + 469 + [[package]] 470 + name = "tracing" 471 + version = "0.1.44" 472 + source = "registry+https://github.com/rust-lang/crates.io-index" 473 + checksum = "63e71662fa4b2a2c3a26f570f037eb95bb1f85397f3cd8076caed2f026a6d100" 474 + dependencies = [ 475 + "log", 476 + "pin-project-lite", 477 + "tracing-core", 478 + ] 479 + 480 + [[package]] 481 + name = "tracing-core" 482 + version = "0.1.36" 483 + source = "registry+https://github.com/rust-lang/crates.io-index" 484 + checksum = "db97caf9d906fbde555dd62fa95ddba9eecfd14cb388e4f491a66d74cd5fb79a" 485 + dependencies = [ 486 + "once_cell", 487 + ] 488 + 489 + [[package]] 490 + name = "unicode-ident" 491 + version = "1.0.22" 492 + source = "registry+https://github.com/rust-lang/crates.io-index" 493 + checksum = "9312f7c4f6ff9069b165498234ce8be658059c6728633667c526e27dc2cf1df5" 494 + 495 + [[package]] 496 + name = "wasi" 497 + version = "0.11.1+wasi-snapshot-preview1" 498 + source = "registry+https://github.com/rust-lang/crates.io-index" 499 + checksum = "ccf3ec651a847eb01de73ccad15eb7d99f80485de043efb2f370cd654f4ea44b" 500 + 501 + [[package]] 502 + name = "windows-link" 503 + version = "0.2.1" 504 + source = "registry+https://github.com/rust-lang/crates.io-index" 505 + checksum = "f0805222e57f7521d6a62e36fa9163bc891acd422f971defe97d64e70d0a4fe5" 506 + 507 + [[package]] 508 + name = "windows-sys" 509 + version = "0.60.2" 510 + source = "registry+https://github.com/rust-lang/crates.io-index" 511 + checksum = "f2f500e4d28234f72040990ec9d39e3a6b950f9f22d3dba18416c35882612bcb" 512 + dependencies = [ 513 + "windows-targets", 514 + ] 515 + 516 + [[package]] 517 + name = "windows-sys" 518 + version = "0.61.2" 519 + source = "registry+https://github.com/rust-lang/crates.io-index" 520 + checksum = "ae137229bcbd6cdf0f7b80a31df61766145077ddf49416a728b02cb3921ff3fc" 521 + dependencies = [ 522 + "windows-link", 523 + ] 524 + 525 + [[package]] 526 + name = "windows-targets" 527 + version = "0.53.5" 528 + source = "registry+https://github.com/rust-lang/crates.io-index" 529 + checksum = "4945f9f551b88e0d65f3db0bc25c33b8acea4d9e41163edf90dcd0b19f9069f3" 530 + dependencies = [ 531 + "windows-link", 532 + "windows_aarch64_gnullvm", 533 + "windows_aarch64_msvc", 534 + "windows_i686_gnu", 535 + "windows_i686_gnullvm", 536 + "windows_i686_msvc", 537 + "windows_x86_64_gnu", 538 + "windows_x86_64_gnullvm", 539 + "windows_x86_64_msvc", 540 + ] 541 + 542 + [[package]] 543 + name = "windows_aarch64_gnullvm" 544 + version = "0.53.1" 545 + source = "registry+https://github.com/rust-lang/crates.io-index" 546 + checksum = "a9d8416fa8b42f5c947f8482c43e7d89e73a173cead56d044f6a56104a6d1b53" 547 + 548 + [[package]] 549 + name = "windows_aarch64_msvc" 550 + version = "0.53.1" 551 + source = "registry+https://github.com/rust-lang/crates.io-index" 552 + checksum = "b9d782e804c2f632e395708e99a94275910eb9100b2114651e04744e9b125006" 553 + 554 + [[package]] 555 + name = "windows_i686_gnu" 556 + version = "0.53.1" 557 + source = "registry+https://github.com/rust-lang/crates.io-index" 558 + checksum = "960e6da069d81e09becb0ca57a65220ddff016ff2d6af6a223cf372a506593a3" 559 + 560 + [[package]] 561 + name = "windows_i686_gnullvm" 562 + version = "0.53.1" 563 + source = "registry+https://github.com/rust-lang/crates.io-index" 564 + checksum = "fa7359d10048f68ab8b09fa71c3daccfb0e9b559aed648a8f95469c27057180c" 565 + 566 + [[package]] 567 + name = "windows_i686_msvc" 568 + version = "0.53.1" 569 + source = "registry+https://github.com/rust-lang/crates.io-index" 570 + checksum = "1e7ac75179f18232fe9c285163565a57ef8d3c89254a30685b57d83a38d326c2" 571 + 572 + [[package]] 573 + name = "windows_x86_64_gnu" 574 + version = "0.53.1" 575 + source = "registry+https://github.com/rust-lang/crates.io-index" 576 + checksum = "9c3842cdd74a865a8066ab39c8a7a473c0778a3f29370b5fd6b4b9aa7df4a499" 577 + 578 + [[package]] 579 + name = "windows_x86_64_gnullvm" 580 + version = "0.53.1" 581 + source = "registry+https://github.com/rust-lang/crates.io-index" 582 + checksum = "0ffa179e2d07eee8ad8f57493436566c7cc30ac536a3379fdf008f47f6bb7ae1" 583 + 584 + [[package]] 585 + name = "windows_x86_64_msvc" 586 + version = "0.53.1" 587 + source = "registry+https://github.com/rust-lang/crates.io-index" 588 + checksum = "d6bbff5f0aada427a1e5a6da5f1f98158182f26556f345ac9e04d36d0ebed650" 589 + 590 + [[package]] 591 + name = "zmij" 592 + version = "1.0.8" 593 + source = "registry+https://github.com/rust-lang/crates.io-index" 594 + checksum = "317f17ff091ac4515f17cc7a190d2769a8c9a96d227de5d64b500b01cda8f2cd"
+3
menu/Cargo.lock.license
··· 1 + SPDX-FileCopyrightText: 2026 Freshly Baked Cake 2 + 3 + SPDX-License-Identifier: CC0-1.0
+8
menu/Cargo.toml
··· 1 + # SPDX-FileCopyrightText: 2026 Freshly Baked Cake 2 + # 3 + # SPDX-License-Identifier: CC0-1.0 4 + 1 5 [package] 2 6 name = "menu" 3 7 version = "0.1.0" 4 8 edition = "2024" 5 9 6 10 [dependencies] 11 + axum = "0.8.8" 12 + tokio = { version = "1.49.0", features = ["macros", "rt-multi-thread"] } 13 + tower-http = { version = "0.6.8", features = ["normalize-path"] } 14 + tower-layer = "0.3.3"
+64 -2
menu/src/main.rs
··· 1 - fn main() { 2 - println!("Hello, world!"); 1 + // SPDX-FileCopyrightText: 2026 Freshly Baked Cake 2 + // 3 + // SPDX-License-Identifier: MIT 4 + 5 + use axum::{ 6 + Router, ServiceExt, 7 + extract::{Path, Query, Request}, 8 + http::StatusCode, 9 + response::{IntoResponse, Redirect}, 10 + routing::get, 11 + }; 12 + use std::{collections::HashMap, env}; 13 + use tower_http::normalize_path::NormalizePathLayer; 14 + use tower_layer::Layer; 15 + 16 + async fn get_redirect(default_location: &str, go: &str) -> Redirect { 17 + Redirect::temporary(&("".to_string() + default_location + go)) 18 + } 19 + 20 + async fn get_redirect_base(go: &str) -> Redirect { 21 + get_redirect("/_/create?path=", go).await 22 + } 23 + 24 + async fn get_redirect_search(go: &str) -> Redirect { 25 + get_redirect("https://kagi.com/search?q=", go).await 26 + } 27 + 28 + async fn handle_root() -> String { 29 + "Hello, world!".to_string() 30 + } 31 + 32 + async fn handle_base(Path(go): Path<String>) -> Redirect { 33 + get_redirect_base(&go).await 34 + } 35 + 36 + async fn handle_search(Query(params): Query<HashMap<String, String>>) -> Redirect { 37 + if let Some(go) = params.get("q") { 38 + get_redirect_search(&go).await 39 + } else { 40 + Redirect::temporary("/") 41 + } 42 + } 43 + 44 + async fn handle_404() -> impl IntoResponse { 45 + (StatusCode::NOT_FOUND, "Not Found") 46 + } 47 + 48 + #[tokio::main] 49 + async fn main() { 50 + let router = Router::new() 51 + .route("/", get(handle_root)) 52 + .route("/_/search", get(handle_search)) 53 + .route("/_/{*route}", get(handle_404)) 54 + .route("/{*go}", get(handle_base)); 55 + let app = NormalizePathLayer::trim_trailing_slash().layer(router); 56 + 57 + let listener = tokio::net::TcpListener::bind( 58 + env::var("BIND_ADDR").unwrap_or_else(|_| "0.0.0.0:3000".to_string()), 59 + ) 60 + .await 61 + .unwrap(); 62 + axum::serve(listener, ServiceExt::<Request>::into_make_service(app)) 63 + .await 64 + .unwrap(); 3 65 }
+3 -3
npins/sources.json
··· 289 289 }, 290 290 "branch": "monthly", 291 291 "submodules": false, 292 - "revision": "f44d7c3596ff028ad9f7fcc31d1941ed585f11b3", 293 - "url": "https://github.com/nix-community/fenix/archive/f44d7c3596ff028ad9f7fcc31d1941ed585f11b3.tar.gz", 294 - "hash": "sha256-6RzWfxENGlO73jQb3uQNgOvubUFwvveeIg+PZxhAu6s=" 292 + "revision": "a3eaf682db8800962943a77ab77c0aae966f9825", 293 + "url": "https://github.com/nix-community/fenix/archive/a3eaf682db8800962943a77ab77c0aae966f9825.tar.gz", 294 + "hash": "sha256-PnQdWvPZqHp+7yaHWDFX3NYSKaOy0fjkwpR+rIQC7AY=" 295 295 }, 296 296 "headscale": { 297 297 "type": "Git",