This commit is contained in:
Cadey Ratio 2020-08-01 22:51:14 +00:00
parent ad7947c5fa
commit ff88b28688
1 changed files with 5 additions and 3 deletions

View File

@ -1,14 +1,14 @@
use async_std::task; use async_std::task;
use dnd_dice_roller::{dice::Dice, error::DiceError}; use dnd_dice_roller::{dice::Dice, error::DiceError};
use maj::{ use maj::{
gemini::{Builder, Node}, gemini::Builder,
route, seg, route, seg,
server::{Error, Handler as MajHandler, Request}, server::{Error, Handler as MajHandler, Request},
split, Response, split, Response,
}; };
use percent_encoding::percent_decode_str; use percent_encoding::percent_decode_str;
use rustls::{ use rustls::{
internal::pemfile::{certs, pkcs8_private_keys, rsa_private_keys}, internal::pemfile::{certs, pkcs8_private_keys},
AllowAnyAnonymousOrAuthenticatedClient, Certificate, PrivateKey, RootCertStore, ServerConfig, AllowAnyAnonymousOrAuthenticatedClient, Certificate, PrivateKey, RootCertStore, ServerConfig,
}; };
use std::{ use std::{
@ -139,7 +139,9 @@ async fn dice(req: Request) -> Result<Response, Error> {
.text("") .text("")
.text(format!("You rolled {} and you got:", dice)) .text(format!("You rolled {} and you got:", dice))
.text("") .text("")
.preformatted(format!("{}", dice_roll(dice)?)); .preformatted(format!("{}", dice_roll(dice)?))
.text("")
.link("/dice", Some("Do another roll".to_string()));
Response::render(b.build()) Response::render(b.build())
}), }),