UNPKG
create-serve
Version:
latest (1.0.1)
1.0.1
1.0.0
0.1.0
0.0.0
🍛 Ultralight http server with live reload. [CLI + API]
github.com/nativew/serve
nativew/serve
create-serve
/
src
/
utils
/
show404.js
10 lines
(8 loc)
•
274 B
JavaScript
View Raw
1
2
3
4
5
6
7
8
9
10
import
fs
from
'fs'
;
import
{ options, encoding }
from
'../index.js'
;
export
const
show404
= response => { fs.
readFile
(
`
${options.root}
/404.html`
,
(
error, content
) =>
{ response.
writeHead
(
404
, {
'Content-Type'
:
'text/html'
}); response.
end
(content, encoding); }); };