Skip to content

Commit baed415

Browse files
save file
1 parent 77006e1 commit baed415

File tree

1 file changed

+27
-14
lines changed

1 file changed

+27
-14
lines changed

blog/25-07-24/http-server/http-server.html

Lines changed: 27 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -124,6 +124,28 @@ <h1 class=title>
124124
</p>
125125

126126

127+
<div class=blog-text>
128+
129+
<h4>
130+
MIME Types
131+
</h4>
132+
133+
<p>
134+
Node.js lacks built in mime type resolution, and sometimes the correct mimetype is needed. Find some functions
135+
to help with this purpose.
136+
<br>
137+
<a href='https://github.com/javascript-2020/libs/blob/main/js/string/getmime/getmime.js' target='_blank'>
138+
https://github.com/javascript-2020/libs/blob/main/js/string/getmime/getmime.js
139+
</a>
140+
<br>
141+
<a href='https://github.com/javascript-2020/libs/blob/main/js/string/getmime/getmime-simple.js' target='_blank'>
142+
https://github.com/javascript-2020/libs/blob/main/js/string/getmime/getmime-simple.js
143+
</a>
144+
</p>
145+
146+
</div>
147+
148+
127149
<div id=simple-root class=example-root>
128150

129151
<div class=blog-text>
@@ -188,19 +210,9 @@ <h4 class=blog-hdr>
188210
</h4>
189211

190212
<p>
191-
This example demonstrates a minimal https server. It has built in https certificate.
192-
</p>
193-
<p>
194-
It serves files local to the base directory where the server was run and produces
195-
a 400 badrequest when the requested url maps to a directory outside the directory where the server is located
196-
such as '../test.txt'.
197-
</p>
198-
<p>
199-
It produces a 404 Not Found should the request url not exists.
200-
</p>
201-
<p>
202-
The mime function will need to built up if it were required.
213+
This example demonstrates a minimal http server. Sometimes simple is best.
203214
</p>
215+
204216
<p>
205217
The server is typically accessed via
206218
<a href='http://localhost:3002/' target='_blank'>
@@ -238,7 +250,7 @@ <h4 class=blog-hdr>
238250

239251

240252
var btn = {};
241-
253+
var kd = {};
242254

243255
//:
244256

@@ -268,7 +280,8 @@ <h4 class=blog-hdr>
268280

269281
switch(name){
270282

271-
case 'simple' : return simple;
283+
case 'simple' : return simple;
284+
case 'minimal' : return minimal;
272285

273286
}//switch
274287

0 commit comments

Comments
 (0)