-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbee.7b
More file actions
143 lines (136 loc) · 2.9 KB
/
Copy pathbee.7b
File metadata and controls
143 lines (136 loc) · 2.9 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
project =simhttp
main=http
common =..${~/~}simscript${~/~}comm-build.7b:file
crate_dir=..${~/~}crates
comp opts=[]
gzip=true
version=1.31
set_env(VERSION,SimHTTP/${version}b85)
if {
eq(${~os~},windows)
then {
assign(ext,.exe)
assign(scr_ext,.bat)
assign(script,START /B .\bin\simhttp.exe %1)
assign(slash,\\\\) # for JSON
assign(port,"")
}
else {
assign(ext,)
assign(scr_ext,.sh)
assign(script,"#!/bin/sh
./bin/simhttp $1&")
assign(slash,/)
assign(port,80)
}
}
mode=mode:prop
if {
eq(mode,release) then {
array(-C,opt-level=3)
assign(comp opts, ~~)
}
}
cfg=cfg:prop
if {
neq(cfg,"cfg") then {
array(comp opts, --cfg,cfg)
assign(comp opts, ~~)
}
}
if {
eq(gzip,true)
then {
array(comp opts, --cfg, feature="gzip")
assign(comp opts,~~)
}
}
target package {
dependency {
target(build)
}
dependency{true}
http conf="{
\"bind\" : \"0.0.0.0\",
\"port\" : ${port}80,
\"threads\" : 20,
\"no terminal\": true,
\"keep_alive_secs\": 10,
\"ping_interval_mins\": 26,
\"max_chunk_size_kilo\": 8192,
\"max_response_size_kilo\": 0,
\"max_request_size_kilo\": 2147483648,
\"mapping\" : [
{\"path\":\"/\",
\"translated\": \".${slash}web\"}
],
\"log\" : {
\"out\": {
\"out _comment_\": \"file\",
\"name\": \"simhttp-${0}\",
\"path\":\".${slash}\",
\"max lines\": 999,
\"max files\": 99
},
\"level\":2
},
\"mime\":
[
{\"ext\":\"html\", \"type\":\"text/html\"},
{\"ext\":\"htm\", \"type\":\"text/html\"},
{\"ext\":\"txt\",\"type\":\"text/plain\"}
]}"
zip(.${~/~}simhttp-${version}.zip,
-A ${project}/env.conf,
${http conf},
-B ${project}/bin,
simhttp${ext},
-A ${project}/web/index.html,"
<!DOCTYPE html>
<html lang=\"en\">
<head>
<meta charset=\"UTF-8\">
<meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\">
<title>Simple HTTP</title>
<style>
:root {
--bg-color: #fff;
--text-color: #000;
}
footer {
text-align: center;
padding: 20px 0;
width: 100%;
}
footer a {
color: #4CAF50;
text-decoration: none;
}
footer a:hover {
text-decoration: underline;
}
@media (prefers-color-scheme: dark) {
:root {
--bg-color: #1e1e1e;
--text-color: #ccc;
color-scheme: dark;
}
}
</style>
</head>
<body>
<header><h1>Rust HTTP Server</h1></header>
<main>
<p>Congratulations! You've successfully installed the server</p>
</main>
<footer><a href=\"https://github.com/vernisaz/simhttp\">SimHTTP</a> v${version} © <script>document.write(new Date().getFullYear())</script> D Rogatkin</footer>
</body>
</html>",
-B ${project},
.${~/~}README.md,
-E ${project}/simhttp${scr_ext},
"${script}")
display(done ${~~})
}
#
include(common);