Browse Source

Remove test code, remake localhost pages

Vova Tkach 6 years ago
parent
commit
6a0e62b9c9

+ 25 - 0
hosts/localhost/htdocs/index.html

@@ -0,0 +1,25 @@
+<!DOCTYPE html>
+<html lang="en">
+	<head>
+		<meta charset="utf-8" />
+		<meta name="theme-color" content="#205081" />
+		<title>First Page</title>
+		<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />
+		<meta name="viewport" content="width=device-width, initial-scale=0.8, maximum-scale=0.8" />
+		<link rel="shortcut icon" href="/assets/sys/fave.ico" type="image/x-icon" />
+		<link rel="stylesheet" type="text/css" media="all" href="/assets/sys/styles.css" />
+		<style type="text/css">a { color: #fff; }</style>
+	</head>
+	<body>
+		<div class="wrapper">
+			<div class="logo">
+				<div class="svg">
+					<img src="/assets/sys/logo.svg" width="150" height="150" />
+				</div>
+			</div>
+			<h1>First Page</h1>
+			<h2><a href="/second.html">Second Page</a></h2>
+			<h2><a href="/robots.txt">Robots.txt</a></h2>
+		</div>
+	</body>
+</html>

+ 24 - 0
hosts/localhost/htdocs/second.html

@@ -0,0 +1,24 @@
+<!DOCTYPE html>
+<html lang="en">
+	<head>
+		<meta charset="utf-8" />
+		<meta name="theme-color" content="#205081" />
+		<title>Second Page</title>
+		<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />
+		<meta name="viewport" content="width=device-width, initial-scale=0.8, maximum-scale=0.8" />
+		<link rel="shortcut icon" href="/assets/sys/fave.ico" type="image/x-icon" />
+		<link rel="stylesheet" type="text/css" media="all" href="/assets/sys/styles.css" />
+		<style type="text/css">a { color: #fff; }</style>
+	</head>
+	<body>
+		<div class="wrapper">
+			<div class="logo">
+				<div class="svg">
+					<img src="/assets/sys/logo.svg" width="150" height="150" />
+				</div>
+			</div>
+			<h1>Second Page</h1>
+			<h2><a href="/">First Page</a></h2>
+		</div>
+	</body>
+</html>

+ 0 - 2
hosts/localhost/htdocs/static.html

@@ -1,2 +0,0 @@
-Static Page<br />
-<a href="/">Main Page</a>

+ 0 - 22
main.go

@@ -3,7 +3,6 @@ package main
 import (
 import (
 	"flag"
 	"flag"
 	"fmt"
 	"fmt"
-	"io"
 	"log"
 	"log"
 	"net/http"
 	"net/http"
 	"os"
 	"os"
@@ -84,27 +83,6 @@ func handler(w http.ResponseWriter, r *http.Request) {
 	// Create and start engine
 	// Create and start engine
 	wrapper.New(&w, r, host, port, FParamWwwDir, FVhostHomeDir, C_Debug).
 	wrapper.New(&w, r, host, port, FParamWwwDir, FVhostHomeDir, C_Debug).
 		Run(func(e *wrapper.Wrapper) bool {
 		Run(func(e *wrapper.Wrapper) bool {
-			if e.R.URL.Path == "/" {
-				if !e.Session.IsSetInt("CounterTest") {
-					e.Session.SetInt("CounterTest", 1)
-				}
-
-				cc, err := e.Session.GetInt("CounterTest")
-				if err != nil {
-					cc = 1
-				}
-
-				(*e.W).Header().Set("Content-Type", "text/html")
-				io.WriteString(*e.W, "Home<br />")
-				io.WriteString(*e.W, "<a href=\"/static.html\">Static Page</a><br />")
-				io.WriteString(*e.W, "<a href=\"/robots.txt\">robots.txt</a><br />")
-				io.WriteString(*e.W, "<a href=\"/static404\">Page 404</a><br />")
-				io.WriteString(*e.W, "Counter: "+strconv.Itoa(cc))
-
-				e.Session.SetInt("CounterTest", cc+1)
-
-				return true
-			}
 			return false
 			return false
 		})
 		})
 }
 }