1
Fork 0

add basic logging of incoming requests

This commit is contained in:
Alan Faubert 2022-07-27 17:51:19 -04:00
parent 1fff807da3
commit ec71240aa3

1
sfs.js
View file

@ -48,6 +48,7 @@ const is_allowed = path => allowed_paths.length === 0 || (path = normalize_path(
http
.createServer(async (req, res) => {
console.log(new Date().toISOString(), req.method, req.url);
if (req.method !== 'GET' && req.method !== 'HEAD') {
send_error(res, 405, 'Method Not Allowed');
return;