Initial commit
This commit is contained in:
commit
ce149890d2
7 changed files with 161 additions and 0 deletions
1
404.html
Normal file
1
404.html
Normal file
|
@ -0,0 +1 @@
|
|||
<h1> 404 </h1>
|
3
features.html
Normal file
3
features.html
Normal file
|
@ -0,0 +1,3 @@
|
|||
<h1> BaseBand's features </h1>
|
||||
|
||||
Lorem ipsum
|
8
index.html
Normal file
8
index.html
Normal file
|
@ -0,0 +1,8 @@
|
|||
<h1> BaseBand </h1>
|
||||
A strong client modification for Minecraft.
|
||||
<br>
|
||||
<br>
|
||||
BaseBand aims to be an easy-to-use yet very extensively configurable client for anarchy servers.
|
||||
<br>
|
||||
<br>
|
||||
<a class=btn href="/features">Features</a>
|
9
lorem-ipsum
Normal file
9
lorem-ipsum
Normal file
|
@ -0,0 +1,9 @@
|
|||
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Etiam egestas ex nisi, ac rhoncus orci suscipit eu. Cras id dolor egestas, molestie sem ut, imperdiet libero. Cras mollis orci a sapien gravida sodales. Nulla facilisi. Phasellus ultrices, odio vitae suscipit semper, quam justo sodales lectus, eget lacinia nisl leo ac turpis. Suspendisse rhoncus tincidunt rutrum. Etiam hendrerit urna a neque ullamcorper varius. Mauris id molestie orci. Quisque ac ipsum risus. Nulla facilisi. Curabitur sit amet neque sit amet leo semper tincidunt eget ac quam. Pellentesque consequat massa eget nibh rhoncus, vel elementum purus fringilla.
|
||||
|
||||
Etiam et porta quam. Fusce laoreet viverra semper. Orci varius natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Aenean a bibendum ex, pharetra vestibulum sem. Aenean ex sem, feugiat quis maximus placerat, pharetra id est. Donec semper mi eget varius sagittis. Pellentesque sit amet felis placerat, congue tortor mollis, vulputate felis. Etiam tempor diam vitae nibh egestas egestas. Quisque hendrerit massa ut ante aliquet mollis. Suspendisse mattis massa interdum, vestibulum magna a, dapibus purus. Suspendisse ac ipsum in eros auctor consequat. Aliquam ac lectus sed orci blandit pellentesque eget at quam. Phasellus quis porttitor nisl, a ultrices sem.
|
||||
|
||||
Morbi lacinia imperdiet neque vitae semper. Morbi sit amet vulputate nisi. Quisque sollicitudin eu dolor et ultrices. Quisque nibh ligula, maximus ac sem vitae, aliquet posuere elit. Quisque quis sapien enim. Praesent et vestibulum nunc. Etiam dictum diam sit amet lorem condimentum, in sollicitudin nisi auctor. In tincidunt dictum convallis. Quisque ut nulla id odio placerat varius. Aenean pretium tincidunt hendrerit. Suspendisse cursus consequat hendrerit. Pellentesque rhoncus imperdiet congue. Etiam dictum nunc arcu, nec ultricies orci vulputate nec. Curabitur euismod augue metus, a iaculis arcu ornare vel.
|
||||
|
||||
In nisl ipsum, condimentum eget nisl et, aliquet aliquet ligula. Ut eget urna vitae felis volutpat maximus id non turpis. Duis lacinia at nisi et consectetur. Donec consectetur eu quam eu varius. Donec maximus molestie nisi eget sollicitudin. Etiam dapibus mi sed tortor suscipit ornare. Ut lectus nisi, iaculis eget tellus non, gravida egestas nibh. Quisque scelerisque ullamcorper libero a mollis. Quisque sed dapibus sem.
|
||||
|
||||
Nunc enim sem, efficitur at quam vitae, ultricies auctor neque. Ut quis libero non augue venenatis consequat. Donec quis velit metus. Nullam eget leo eu massa bibendum consectetur. Aliquam volutpat non leo quis venenatis. Fusce iaculis massa quis magna hendrerit, at feugiat ex ultricies. Phasellus ligula sapien, finibus et tempus quis, finibus vitae elit. Nunc sit amet purus non ligula vulputate commodo.
|
57
server.spl
Normal file
57
server.spl
Normal file
|
@ -0,0 +1,57 @@
|
|||
"#http/server.spl" import
|
||||
|
||||
func destub { html | with html title ;
|
||||
stub.html
|
||||
:replace<"+title" title>
|
||||
:replace<"+body" html>
|
||||
:replace<"Lorem ipsum" lorem-ipsum>
|
||||
}
|
||||
|
||||
def lorem-ipsum "lorem-ipsum" read-file:replace<"\n" "<br>"> =lorem-ipsum
|
||||
|
||||
def stub.html "stub.html" read-file =stub.html
|
||||
def style.css "style.css" read-file =style.css
|
||||
def 404.html "404.html" read-file destub<"404"> =404.html
|
||||
|
||||
def index.html "index.html" read-file destub<"Home"> =index.html
|
||||
def features.html "features.html" read-file destub<"Features"> =features.html
|
||||
|
||||
func main { mega | with args ;
|
||||
def server net:http:Server:new<"localhost" 13130> =server
|
||||
|
||||
"server is listening on 13130" println;
|
||||
|
||||
while { 1 } {
|
||||
server:accept { | with client ;
|
||||
catch {
|
||||
client:read;
|
||||
|
||||
client handle-client;
|
||||
} { with err ;
|
||||
"A request has errored out with " err:message concat println;
|
||||
"at: " println;
|
||||
&println err:trace:foreach;
|
||||
}
|
||||
} fork pop
|
||||
}
|
||||
|
||||
0
|
||||
}
|
||||
|
||||
func handle-client { | with client ;
|
||||
client:path "/" eq if {
|
||||
index.html client:write-ok:write-html-body:finish;
|
||||
2 stop
|
||||
}
|
||||
client:path "/features" eq if {
|
||||
features.html client:write-ok:write-html-body:finish;
|
||||
2 stop
|
||||
}
|
||||
|
||||
client:path "/style.css" eq if {
|
||||
style.css client:write-ok:write-content-type<"text/css">:write-str-body:finish;
|
||||
2 stop
|
||||
}
|
||||
|
||||
404.html client:write-head<404 "Not found">:write-html-body:finish;
|
||||
}
|
12
stub.html
Normal file
12
stub.html
Normal file
|
@ -0,0 +1,12 @@
|
|||
<!DOCTYPE html>
|
||||
|
||||
<html>
|
||||
<head>
|
||||
<meta name="viewport" content="width=device-width height=device-height">
|
||||
<link rel="stylesheet" href="/style.css">
|
||||
<title> BaseBand - +title </title>
|
||||
</head>
|
||||
<body>
|
||||
+body
|
||||
</body>
|
||||
</html>
|
71
style.css
Normal file
71
style.css
Normal file
|
@ -0,0 +1,71 @@
|
|||
html {
|
||||
margin: 0;
|
||||
background-color: #502060;
|
||||
color: #00cccc;
|
||||
font-family: Monocraft monospace;
|
||||
}
|
||||
body {
|
||||
margin: auto;
|
||||
display: block;
|
||||
width: min(700px, 90vw);
|
||||
margin-top: min(10em, 30vh);
|
||||
margin-bottom: min(10em, 30vh);
|
||||
}
|
||||
a {
|
||||
color: #00ffff;
|
||||
}
|
||||
|
||||
a.btn {
|
||||
background-color: #603060;
|
||||
display: inline-block;
|
||||
width: 10em;
|
||||
max-width: calc(100vw - 30px);
|
||||
min-width: fit-content;
|
||||
padding: 10px;
|
||||
margin: 0;
|
||||
text-decoration: none;
|
||||
text-align: center;
|
||||
transition: 0.2s;
|
||||
}
|
||||
a.btn:hover {
|
||||
background-color: #605070;
|
||||
}
|
||||
|
||||
form {
|
||||
background-color: #425;
|
||||
padding: 10px;
|
||||
margin: 20px auto 20px auto;
|
||||
width: fit-content;
|
||||
}
|
||||
label {
|
||||
text-align: right;
|
||||
display: block;
|
||||
}
|
||||
input {
|
||||
height: 2em;
|
||||
margin-bottom: 0.5em;
|
||||
border: 0;
|
||||
background-color: #000;
|
||||
color: #f0f;
|
||||
}
|
||||
button {
|
||||
background-color: #a0a;
|
||||
color: #000;
|
||||
border: 0;
|
||||
width: 100%;
|
||||
height: 2em;
|
||||
cursor: pointer;
|
||||
transition: 0.2s;
|
||||
}
|
||||
button:hover {
|
||||
background-color: #909;
|
||||
}
|
||||
|
||||
div.error {
|
||||
background-color: #913;
|
||||
color: #fff;
|
||||
display: block;
|
||||
width: calc(100% - 60px);
|
||||
padding: 15px;
|
||||
margin: 15px;
|
||||
}
|
Loading…
Add table
Reference in a new issue