mirror of
https://github.com/ajnart/homarr.git
synced 2025-11-09 23:15:46 +01:00
✨ Add "Add to homarr" feature and move code
This commit is contained in:
@@ -5,12 +5,8 @@ import Docker from 'dockerode';
|
||||
const docker = new Docker();
|
||||
|
||||
async function Get(req: NextApiRequest, res: NextApiResponse) {
|
||||
docker.listContainers({ all: true }, (err, containers) => {
|
||||
if (err) {
|
||||
res.status(500).json({ error: err });
|
||||
}
|
||||
return res.status(200).json(containers);
|
||||
});
|
||||
const containers = await docker.listContainers({ all: true });
|
||||
return res.status(200).json(containers);
|
||||
}
|
||||
|
||||
export default async (req: NextApiRequest, res: NextApiResponse) => {
|
||||
|
||||
Reference in New Issue
Block a user