wild card UI done
This commit is contained in:
+22
-9
@@ -29,7 +29,19 @@ router.post('/', async function(req, res, next){
|
||||
}
|
||||
});
|
||||
|
||||
router.get('/:item(*)', async function(req, res, next){
|
||||
router.get('/lookup/:item', async function(req, res, next){
|
||||
try{
|
||||
return res.json({
|
||||
string: req.params.item,
|
||||
results: await Model.lookUp(req.params.item),
|
||||
});
|
||||
|
||||
}catch(error){
|
||||
return next(error);
|
||||
}
|
||||
});
|
||||
|
||||
router.get('/:item', async function(req, res, next){
|
||||
try{
|
||||
|
||||
return res.json({
|
||||
@@ -41,7 +53,7 @@ router.get('/:item(*)', async function(req, res, next){
|
||||
}
|
||||
});
|
||||
|
||||
router.put('/:item(*)', async function(req, res, next){
|
||||
router.put('/:item', async function(req, res, next){
|
||||
try{
|
||||
req.body.updated_by = req.user.username;
|
||||
let item = await Model.get(req.params.item);
|
||||
@@ -59,7 +71,7 @@ router.put('/:item(*)', async function(req, res, next){
|
||||
}
|
||||
});
|
||||
|
||||
router.delete('/:item(*)', async function(req, res, next){
|
||||
router.delete('/:item', async function(req, res, next){
|
||||
try{
|
||||
let item = await Model.get(req.params.item);
|
||||
let count = await item.remove();
|
||||
@@ -74,15 +86,16 @@ router.delete('/:item(*)', async function(req, res, next){
|
||||
}
|
||||
});
|
||||
|
||||
router.get('/lookup/:item(*)', async function(req, res, next){
|
||||
router.put('/:item/renew', async function(req, res, next){
|
||||
try{
|
||||
return res.json({
|
||||
string: req.params.item,
|
||||
results: await Model.lookUp(req.params.item),
|
||||
});
|
||||
let item = await Model.get(req.params.item);
|
||||
item.createWildcardCert();
|
||||
|
||||
return res.json({
|
||||
message: `Requesting wildcard cert for ${req.params.item}`,
|
||||
})
|
||||
}catch(error){
|
||||
return next(error);
|
||||
next(error);
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user