require -> import

git-svn-id: https://www.unprompted.com/svn/projects/tildefriends/trunk@3904 ed5197a5-7fde-0310-b194-c3ffbd925b24
This commit is contained in:
2022-06-18 17:39:08 +00:00
parent ed6550a4cd
commit 2d8a956c14
8 changed files with 43 additions and 45 deletions

View File

@ -1,7 +1,6 @@
"use strict";
var auth = require("auth");
var app = require("app");
import * as auth from './auth.js';
import * as app from './app.js';
import * as httpd from './httpd.js';
var gProcessIndex = 0;
var gProcesses = {};
@ -559,8 +558,6 @@ function enableStats(process, enabled) {
}
loadSettings().then(function() {
var auth = require("auth");
var httpd = require("httpd");
httpd.all("/login", auth.handler);
httpd.all("", function(request, response) {
var match;
@ -600,12 +597,14 @@ loadSettings().then(function() {
httpd.registerSocketHandler("/app/socket", app.socket);
}).catch(function(error) {
print('Failed to load settings.');
print(error);
printError({print: print}, error);
exit(1);
});
exports.getSessionProcessBlob = getSessionProcessBlob;
exports.invoke = invoke;
exports.globalSettings = gGlobalSettings;
exports.setGlobalSettings = setGlobalSettings;
exports.enableStats = enableStats;
export {
gGlobalSettings as globalSettings,
setGlobalSettings,
enableStats,
invoke,
getSessionProcessBlob
};