瀏覽代碼

Got the damn thing working

master
Noelle 4 年之前
父節點
當前提交
2ffa986c6e
共有 2 個檔案被更改,包括 3 行新增3 行删除
  1. 2
    2
      index.html
  2. 1
    1
      src/main.rs

+ 2
- 2
index.html 查看文件

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

+ 1
- 1
src/main.rs 查看文件

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

Loading…
取消
儲存