commit
411efe5276
@ -1,9 +0,0 @@
|
|||||||
<!Doctype html>
|
|
||||||
<html>
|
|
||||||
<head>
|
|
||||||
<title>Page Not Found | Hermes</title>
|
|
||||||
</head>
|
|
||||||
<body>
|
|
||||||
<p>The requested page could not be found.</p>
|
|
||||||
</body>
|
|
||||||
</html>
|
|
||||||
3
public/404.json
Normal file
3
public/404.json
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
{
|
||||||
|
"detail": "Route not found, or request malformed...thats all im saying."
|
||||||
|
}
|
||||||
@ -12,7 +12,12 @@ struct IncomingRequest {
|
|||||||
|
|
||||||
// Listen on port and return response.
|
// Listen on port and return response.
|
||||||
fn main() {
|
fn main() {
|
||||||
let listener = TcpListener::bind("164.92.85.112:7878").unwrap();
|
let run_local = false;
|
||||||
|
let mut listener = TcpListener::bind("127.0.0.1:6942").unwrap();
|
||||||
|
|
||||||
|
if !run_local {
|
||||||
|
listener = TcpListener::bind("164.92.85.112:7878").unwrap();
|
||||||
|
}
|
||||||
|
|
||||||
for stream in listener.incoming() {
|
for stream in listener.incoming() {
|
||||||
let stream = stream.unwrap();
|
let stream = stream.unwrap();
|
||||||
@ -70,7 +75,7 @@ fn get_api_key(headers: Vec<String>) -> String {
|
|||||||
// Return a 404.
|
// Return a 404.
|
||||||
fn return_404() -> String {
|
fn return_404() -> String {
|
||||||
let status_line = "HTTP/1.1 404 Not Found";
|
let status_line = "HTTP/1.1 404 Not Found";
|
||||||
let contents = fs::read_to_string("./public/404.html").unwrap();
|
let contents = fs::read_to_string("./public/404.json").unwrap();
|
||||||
let length = contents.len();
|
let length = contents.len();
|
||||||
|
|
||||||
let response =
|
let response =
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user