1
0
mirror of https://github.com/TheGreyDiamond/Enlight.git synced 2025-07-18 04:33:50 +02:00

More unamed stuff

This commit is contained in:
TheGreyDiamond
2020-11-28 23:42:57 +01:00
parent 472984f9e7
commit 2edc4deb94
2 changed files with 26 additions and 204 deletions

View File

@ -5,7 +5,8 @@ const { win32 } = require("path");
const sysInf = require("systeminformation");
const dgram = require("dgram");
var server = dgram.createSocket("udp4");
const express = require('express')
const express = require('express');
const { time } = require("console");
const restApp = express()
const restPort = 33334;
@ -39,6 +40,14 @@ pageLookup["header"] = "header.html"
var sessionState = -1;
var sessionStateGoal = -1;
var mySession = {
name: "Unnamed Session",
joinable: true,
passwordProtected: false,
passwordHash: "",
members: 1
};
var mainConn = "";
var mainNetworkInterface = undefined;
@ -194,11 +203,11 @@ function init() {
})
restApp.get('/api/v1/ping', (req, res) => {
res.json({state:"Succes"});
res.json({state:"Succes", uptime: time.time()});
})
restApp.get('/api/v1/session/info', (req, res) => {
res.json({state:"Succes", implementation: "Not yet implemted."});
res.json({state:"Succes", name: mySession.name, joinAble: mySession.joinable, passwordProtected: mySession.passwordProtected});
})
}, 20);