Subdomain Anzeige mit Ips
This commit is contained in:
@@ -52,4 +52,39 @@ res.status(500).json({error:"DB error"})
|
||||
|
||||
})
|
||||
|
||||
|
||||
router.delete("/:id", async (req,res)=>{
|
||||
|
||||
await db.query("DELETE FROM subdomains WHERE id=?",[req.params.id])
|
||||
|
||||
res.json({success:true})
|
||||
|
||||
})
|
||||
|
||||
|
||||
router.post("/", async (req,res)=>{
|
||||
|
||||
try{
|
||||
|
||||
const {domain_id, subdomain, ip_address} = req.body
|
||||
|
||||
await db.query(`
|
||||
INSERT INTO subdomains
|
||||
(domain_id, subdomain, ip_address)
|
||||
VALUES (?,?,?)
|
||||
`,[domain_id, subdomain, ip_address])
|
||||
|
||||
res.json({success:true})
|
||||
|
||||
}catch(e){
|
||||
|
||||
console.error("CREATE subdomain error:",e)
|
||||
res.status(500).json({error:"DB error"})
|
||||
|
||||
}
|
||||
|
||||
})
|
||||
|
||||
module.exports = router
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user