forked from MapComplete/MapComplete
Merge master
This commit is contained in:
commit
f51b51c491
340 changed files with 15515 additions and 11114 deletions
|
@ -62,6 +62,7 @@ function genImages(dryrun = false) {
|
|||
"brick_wall_round",
|
||||
"bug",
|
||||
"back",
|
||||
"person",
|
||||
].map((s) => s.toLowerCase())
|
||||
const dir = fs.readdirSync("./assets/svg")
|
||||
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue