DockerRestApi/routes/start.js

18 lines
383 B
JavaScript
Raw Normal View History

2019-09-19 16:07:12 +00:00
var express = require('express');
var router = express.Router();
2019-09-19 16:30:38 +00:00
var docker = require('../bin/dockerode');
2019-09-19 16:07:12 +00:00
router.get('/', function (req, res, next) {
2019-09-19 16:27:24 +00:00
res.send(getContainer('Portainer'));
2019-09-19 16:07:12 +00:00
});
module.exports = router;
2019-09-19 16:27:24 +00:00
function getContainer(containername) {
var container = docker.getContainer(containername);
container.inspect(function (err, data) {
return data
});
}