Chore: housekeeping: lint

This commit is contained in:
Pieter Vander Vennet 2023-12-19 22:08:00 +01:00
parent 2cbd709d71
commit 663b194247
334 changed files with 4675 additions and 1730 deletions

View file

@ -58,18 +58,18 @@ async function handleDelete(req: http.IncomingMessage, res: ServerResponse) {
res.writeHead(304, { "Content-Type": MIME_TYPES.html })
res.write("<html><body>No parent directory, nothing deleted</body></html>", "utf8")
res.end()
return
return
}
}
const path = STATIC_PATH + paths.join("/")
if(!fs.existsSync(path)){
if (!fs.existsSync(path)) {
res.writeHead(304, { "Content-Type": MIME_TYPES.html })
res.write("<html><body>File not found</body></html>", "utf8")
res.end()
return
}
fs.renameSync(path, path+".bak")
fs.renameSync(path, path + ".bak")
res.writeHead(200, { "Content-Type": MIME_TYPES.html })
res.write("<html><body>File moved to backup</body></html>", "utf8")
res.end()
@ -115,7 +115,12 @@ async function handlePost(req: http.IncomingMessage, res: ServerResponse) {
http.createServer(async (req: http.IncomingMessage, res) => {
try {
console.log(req.method + " " + req.url, "from:", req.headers.origin, new Date().toISOString())
console.log(
req.method + " " + req.url,
"from:",
req.headers.origin,
new Date().toISOString()
)
res.setHeader(
"Access-Control-Allow-Headers",
"Origin, X-Requested-With, Content-Type, Accept"
@ -132,7 +137,7 @@ http.createServer(async (req: http.IncomingMessage, res) => {
return
}
if(req.method === "DELETE"){
if (req.method === "DELETE") {
console.log("Got a DELETE", new Date())
await handleDelete(req, res)
return