3136352472 5 years ago
parent
commit
acf6470e01
  1. 14
      lib/http.js
  2. 8
      main.js

14
lib/http.js

@ -0,0 +1,14 @@
var http = require("http");
exports.start = function () {
http.createServer(function (request, response) {
let body = [];
request.on('data', (chunk) => {
body.push(chunk);
}).on('end', () => {
body = Buffer.concat(body).toString();
// at this point, `body` has the entire request body stored in it as a string
console.log("body is " + body);
});
}).listen(37188);
}

8
main.js

@ -3,6 +3,7 @@ const { app, BrowserWindow } = require('electron')
const path = require('path')
const main = require(path.join(__dirname, "lib/main.js"))
const mhttp = require(path.join(__dirname, "lib/http.js"))
@ -15,6 +16,13 @@ app.whenReady().then(function () {
main.createMainWindow()
const tray = require(path.join(__dirname, "lib/tray.js"))
if (app.dock) {
app.dock.hide();
}
mhttp.start();
// tray.createTrayWindow()
})

Loading…
Cancel
Save