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:
15
index.js
15
index.js
@ -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);
|
||||
|
||||
|
Reference in New Issue
Block a user