Gamaliel Espinoza преди 7 години
родител
ревизия
08d4d8faf5
променени са 2 файла, в които са добавени 12 реда и са изтрити 1 реда
  1. 10 0
      ondemand.js
  2. 2 1
      package.json

+ 10 - 0
ondemand.js

@@ -2,6 +2,7 @@ const config = require("fourier-common").config;
 const db = require("fourier-common").fbconn.database();
 const spawn = require("child_process").spawn;
 const path = require("path");
+const express = require('express');
 
 var working = false;
 
@@ -94,6 +95,15 @@ function start() {
   //});
 }
 
+endpoint.get('/info', function(request, response) {
+  response.send(JSON.stringify({
+    'version': version,
+    'processID': process.id,
+    'memoryUsage': process.memoryUsage().rss
+  }));
+});
+endpoint.listen(49223);
+
 function stop() {
   od_ref.off();
   queue = {};

+ 2 - 1
package.json

@@ -1,9 +1,10 @@
 {
   "name": "fourier-ondemand",
-  "version": "1.0.0",
+  "version": "1.0.1b1",
   "description": "",
   "main": "index.js",
   "dependencies": {
+    "express": "^4.16.2",
     "fourier-common": "file:../common/"
   },
   "scripts": {