SQL database is now accessable. CSS and JS implemented
This commit is contained in:
parent
be4063d9d5
commit
c66a8ae60e
4 changed files with 17 additions and 20 deletions
|
@ -3,11 +3,15 @@
|
||||||
<head>
|
<head>
|
||||||
<meta charset="utf-8">
|
<meta charset="utf-8">
|
||||||
<link rel="icon" href="/favicon.ico" type="image/webp" />
|
<link rel="icon" href="/favicon.ico" type="image/webp" />
|
||||||
<title>Hello!</title>
|
<link rel="stylesheet" href="/style.css" />
|
||||||
|
<title>Main</title>
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
<h1>Hello!</h1>
|
<h1>Hello!</h1>
|
||||||
<p>Hi from Rust.</p>
|
<p>Hi from Rust.</p>
|
||||||
<a href="/Profile">View your profile.</a>
|
<a href="/Profile">View your profile.</a>
|
||||||
|
|
||||||
|
<script src="script.js"></script>
|
||||||
|
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
|
|
@ -1,9 +1,13 @@
|
||||||
body {
|
body {
|
||||||
text-align: center
|
text-align: center;
|
||||||
|
justify-content: center;
|
||||||
}
|
}
|
||||||
|
|
||||||
h1 {
|
h1 {
|
||||||
font-size: 10%
|
font-size: 8ch;
|
||||||
|
|
||||||
|
margin-top: 0;
|
||||||
|
margin-bottom: 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
p {
|
p {
|
||||||
|
|
|
@ -1,17 +0,0 @@
|
||||||
<!DOCTYPE html>
|
|
||||||
<html lang="en">
|
|
||||||
<head>
|
|
||||||
<meta charset="utf-8">
|
|
||||||
<link rel="icon" href="/favicon.ico" type="image/webp" />
|
|
||||||
<link rel="stylesheet" href="/style.css" />
|
|
||||||
<title>Main</title>
|
|
||||||
</head>
|
|
||||||
<body>
|
|
||||||
<h1>Hello!</h1>
|
|
||||||
<p>Hi from Rust.</p>
|
|
||||||
<a href="/Profile">View your profile.</a>
|
|
||||||
|
|
||||||
<script src="script.js"></script>
|
|
||||||
|
|
||||||
</body>
|
|
||||||
</html>
|
|
|
@ -41,6 +41,12 @@ fn main(){
|
||||||
(GET) ["/favicon.ico"] => {
|
(GET) ["/favicon.ico"] => {
|
||||||
Response::from_file("image/vnd.microsoft.icon", File::open("src/HTTP/favicon.ico").unwrap()).with_status_code(200)
|
Response::from_file("image/vnd.microsoft.icon", File::open("src/HTTP/favicon.ico").unwrap()).with_status_code(200)
|
||||||
},
|
},
|
||||||
|
(GET) ["/style.css"] => {
|
||||||
|
Response::from_file("text/css", File::open("src/HTTP/style.css").unwrap()).with_status_code(200)
|
||||||
|
},
|
||||||
|
(GET) ["/script.js"] => {
|
||||||
|
Response::from_file("text/javascript", File::open("src/HTTP/script.js").unwrap()).with_status_code(200)
|
||||||
|
},
|
||||||
// Catch-all. Fuck you.
|
// Catch-all. Fuck you.
|
||||||
_ => {
|
_ => {
|
||||||
Response::from_file("text/html", File::open("src/HTTP/404.html").unwrap()).with_status_code(404)
|
Response::from_file("text/html", File::open("src/HTTP/404.html").unwrap()).with_status_code(404)
|
||||||
|
|
Loading…
Add table
Reference in a new issue