我有一个简单的shell脚本:
#!/bin/bash
echo "hello john"
我还有一个非常基本的服务器文件:
var express = require('express');
var app = express();
app.get('/', function (req, res) {
/*
Code to execute the shell script
*/
});
var server = app.listen(3000, function () {
var host = server.address().address;
var port = server.address().port;
console.log('App listening at http://%s:%s', host, port);
});