/******************************************************************************
This is a multi threaded inplementation of a web server written using Rust
Obviously this wont run in the playpen. The thread pool is implemented as a lib
The app uses 2 html files - index and 404 when you pass a valid function
it will append the results of the function called by the argument ie ?best5
this runs on the https://www.yellowrockonline.com.au/rust end point
//index.html
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Hello!</title>
</head>
<body>
<h1>Hello!</h1>
<p>Hi from YellowRockOnline <a href='https://onlinegdb.com/tE5IlJUjX'>'code for this page'</a></a></p>
</body>
</html>
*******************************************************************************/
use combinations::Combinations;
use tuple_conv::RepeatedTuple;
use csv;
//use std::{error::Error, string};
use std::{error::Error};
use orion::aead;
use once_cell::sync::Lazy;
use web::ThreadPool;
use std::{
fs::File,
fs,
io::{prelude::*, BufReader},
net::{TcpListener, TcpStream},
collections::HashMap,
time::Instant,
path::Path,
};
use anyhow::Result;
use itertools::Itertools;
use serde::Serialize;
use serde::Deserialize;
use serde_json;
use rand_chacha::ChaCha20Rng;
use rand::prelude::*;
use rand::seq::SliceRandom;
use rand::thread_rng;
use chrono::{DateTime, Local};
//static SECRETKEY:aead::SecretKey = aead::SecretKey::default();
static SECRETKEY: Lazy<aead::SecretKey > = Lazy::new(|| {
println!("initializing aead SecretKey");
aead::SecretKey::default()
});
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
You must be logged on to see the code.
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++