-
Notifications
You must be signed in to change notification settings - Fork 1
/
server.js
24 lines (18 loc) · 670 Bytes
/
server.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
var express = require('express'),
bodyParser = require('body-parser'),
ssh = require('./app/ssh'),
management = require('./app/management'),
getList = require('./app/pc-list');
var app = express();
app.use(bodyParser.json());
app.use(bodyParser.urlencoded( {extended: false } ));
app.use(express.static(__dirname + '/public'));
app.get('/', function(req, res) {
res.sendFile(__dirname + '/public/app/views/index.html');
})
app.get('/api/computers', getList.computers);
app.post('/api/shutdown/:ip', management.shutdown);
app.get('/api/virtlist/:ip', management.getVirts);
app.listen(7070, function() {
console.log("Server listening on port %d", 7070);
});