Skip to content

Commit

Permalink
fix moment module
Browse files Browse the repository at this point in the history
  • Loading branch information
mohsenasm committed Jan 1, 2025
1 parent a36272f commit 2936e40
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions server/index.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { readFileSync, watchFile } from 'node:fs';
import { request, createServer } from 'http';
import { createServer as _createServer } from 'https';
import { request, createServer as httpCreateServer } from 'http';
import { createServer as httpsCreateServer } from 'https';
import { createHash } from 'crypto';
import parsePrometheusTextFormat from 'parse-prometheus-text-format';

Expand All @@ -10,7 +10,7 @@ import basicAuth from 'express-basic-auth';
import { v4 as uuidv4 } from 'uuid';
import { parse } from 'url';
import { sortBy, prop } from 'ramda';
import moment, { duration } from 'moment';
import moment from 'moment';

const port = process.env.PORT || 8080;
const realm = process.env.AUTHENTICATION_REALM || "KuW2i9GdLIkql";
Expand Down Expand Up @@ -224,7 +224,7 @@ const parseAndRedactDockerData = data => {
const lastTimestamp = moment(baseTask["Status"]["Timestamp"]);
let timestateInfo = undefined;
if (showTaskTimestamp) {
timestateInfo = duration(lastTimestamp - now).humanize(true);
timestateInfo = moment.duration(lastTimestamp - now).humanize(true);
}
let task = {
"ID": baseTask["ID"],
Expand Down Expand Up @@ -667,7 +667,7 @@ if (enableHTTPS) {
const privateKey = readFileSync(privateKeyPath, 'utf8');
const certificate = readFileSync(certificatePath, 'utf8');
const credentials = { key: privateKey, cert: certificate }
const httpsServer = _createServer(credentials);
const httpsServer = httpsCreateServer(credentials);
httpsServer.on('request', app);
const wsServer = new WebSocket.Server({
path: pathPrefix + '/stream',
Expand All @@ -689,7 +689,7 @@ if (enableHTTPS) {
}
});
} else {
const httpServer = createServer();
const httpServer = httpCreateServer();
httpServer.on('request', app);
const wsServer = new WebSocket.Server({
path: pathPrefix + '/stream',
Expand Down

0 comments on commit 2936e40

Please sign in to comment.