|
@@ -0,0 +1,18 @@
|
|
|
|
+const http = require('http');
|
|
|
|
+const ps = require('child_process');
|
|
|
|
+
|
|
|
|
+// 端口
|
|
|
|
+let port = 5900;
|
|
|
|
+
|
|
|
|
+http.createServer((req, res) => {
|
|
|
|
+ let url = req.url;
|
|
|
|
+ if(url.indexOf("/blog") != -1)
|
|
|
|
+ {
|
|
|
|
+ let proc = ps.exec("blog.sh");
|
|
|
|
+ proc.stdout.pipe(process.stdout);
|
|
|
|
+ proc.stderr.pipe(process.stderr);
|
|
|
|
+ res.end("ok");
|
|
|
|
+ }
|
|
|
|
+}).listen(port, ()=>{
|
|
|
|
+ console.log(`start node server:${port}`);
|
|
|
|
+})
|