better match for host param

This commit is contained in:
2021-01-12 17:19:14 -05:00
parent c244c2e972
commit 18f1f19211
+4 -4
View File
@@ -27,7 +27,7 @@ router.post('/', async function(req, res, next){
}
});
router.get('/:host', async function(req, res, next){
router.get('/:host(*)', async function(req, res, next){
try{
return res.json({
@@ -39,7 +39,7 @@ router.get('/:host', async function(req, res, next){
}
});
router.put('/:host', async function(req, res, next){
router.put('/:host(*)', async function(req, res, next){
try{
req.body.updated_by = req.user.username;
let host = await Host.get(req.params.host);
@@ -55,7 +55,7 @@ router.put('/:host', async function(req, res, next){
}
});
router.delete('/:host', async function(req, res, next){
router.delete('/:host(*)', async function(req, res, next){
try{
let host = await Host.get(req.params);
let count = await host.remove.call(host, host);
@@ -69,7 +69,7 @@ router.delete('/:host', async function(req, res, next){
}
});
router.get('/lookup/:host', async function(req, res, next){
router.get('/lookup/:host(*)', async function(req, res, next){
try{
return res.json({
string: req.params.host,