Browse Source

Got the damn thing working

master
Noelle 4 years ago
parent
commit
2ffa986c6e
2 changed files with 3 additions and 3 deletions
  1. 2
    2
      index.html
  2. 1
    1
      src/main.rs

+ 2
- 2
index.html View File

<html lang="en"> <html lang="en">
<head> <head>
<meta charset="utf-8"> <meta charset="utf-8">
<title>Hello!</title>
<title>Index!</title>
</head> </head>
<body> <body>
<h1>Hello!</h1> <h1>Hello!</h1>
<p>Hi from Rust</p>
<p>This is the index page. It's different from the hello page.</p>
</body> </body>
</html> </html>

+ 1
- 1
src/main.rs View File

match caps { match caps {
Some(cap) => { Some(cap) => {
let c = cap.get(1).unwrap().as_str(); let c = cap.get(1).unwrap().as_str();
println!("Asked to fetch {}", c);
// println!("Asked to fetch {}", c);
//assert!(Path::new(c).exists()); //assert!(Path::new(c).exists());
if c == "" { if c == "" {
("HTTP/1.1 200 OK\r\n\r\n", "index.html") ("HTTP/1.1 200 OK\r\n\r\n", "index.html")

Loading…
Cancel
Save