mirror of
https://github.com/Noratrieb/viewstrap.git
synced 2026-01-14 16:45:10 +01:00
evil scientist things
This commit is contained in:
parent
1855296152
commit
57f95f95d3
2 changed files with 36 additions and 1 deletions
|
|
@ -0,0 +1,24 @@
|
||||||
|
<!DOCTYPE html>
|
||||||
|
<html lang="en">
|
||||||
|
<head>
|
||||||
|
<meta charset="UTF-8" />
|
||||||
|
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
|
||||||
|
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
||||||
|
<title>Document</title>
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<button onclick="startWs()">build me a compiler</button>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
function startWs() {
|
||||||
|
console.log("starting ws");
|
||||||
|
|
||||||
|
const ws = new WebSocket("ws://localhost:3000/ws");
|
||||||
|
|
||||||
|
ws.addEventListener("open", () => {
|
||||||
|
ws.send("uwu!");
|
||||||
|
});
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
13
src/main.rs
13
src/main.rs
|
|
@ -24,13 +24,24 @@ async fn main() {
|
||||||
tracing_subscriber::registry()
|
tracing_subscriber::registry()
|
||||||
.with(
|
.with(
|
||||||
tracing_subscriber::EnvFilter::try_from_default_env()
|
tracing_subscriber::EnvFilter::try_from_default_env()
|
||||||
.unwrap_or_else(|_| "viewstrap=debug,tower_http=debug".into()),
|
.unwrap_or_else(|_| "viewstrap=debug".into()),
|
||||||
)
|
)
|
||||||
.with(tracing_subscriber::fmt::layer())
|
.with(tracing_subscriber::fmt::layer())
|
||||||
.init();
|
.init();
|
||||||
|
|
||||||
info!("bootstrapping viewstrap...");
|
info!("bootstrapping viewstrap...");
|
||||||
|
|
||||||
|
let Some(rustc_src_dir) = std::env::args().nth(1) else {
|
||||||
|
error!("most provide rust source dir as the first argument");
|
||||||
|
std::process::exit(1);
|
||||||
|
};
|
||||||
|
|
||||||
|
let entrypoint = PathBuf::from(rustc_src_dir).join(if cfg!(windows) { "x.ps1" } else { "x" });
|
||||||
|
if !entrypoint.exists() {
|
||||||
|
error!("{} not found, your rust source is either really old or not a rust source and you lied to me.", entrypoint.display());
|
||||||
|
std::process::exit(1);
|
||||||
|
}
|
||||||
|
|
||||||
let assets_dir = PathBuf::from(env!("CARGO_MANIFEST_DIR")).join("assets");
|
let assets_dir = PathBuf::from(env!("CARGO_MANIFEST_DIR")).join("assets");
|
||||||
|
|
||||||
// build our application with some routes
|
// build our application with some routes
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue