forked from OpenFPGAduino/Arduinojs
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtty.js
More file actions
29 lines (26 loc) · 686 Bytes
/
tty.js
File metadata and controls
29 lines (26 loc) · 686 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
module.exports = function(app, logger, express, argv) {
logger.info('module tty');
var router = express.Router();
var ttyserver;
router.get('/start', function(req, res) {
var tty = require('tty.js');
ttyserver = tty.createServer({
shell: 'bash',
users: {
openfpgaduino: 'lab123'
},
port: 8000
});
ttyserver.listen();
res.json({
message: 'start the tty!'
});
});
router.get('/stop', function(req, res) {
delete ttyserver;
res.json({
message: 'stop the tty!'
});
});
app.use('/tty', router);
}