esm > nodejs

This commit is contained in:
Marco van Dijk 2023-11-03 01:57:37 +01:00
parent 0858d0b83d
commit dd6021fe49
9 changed files with 26 additions and 28 deletions

View File

@ -3,7 +3,7 @@ module.exports = {
{
name: "client-orchestrator-prober",
script: "./src/client.js",
cwd: "/orchTest/client",
cwd: "/home/marco/repos/OrchestratorAvailability/client",
env_production: {
NODE_ENV: "production"
},

View File

@ -3,7 +3,7 @@
"version": "0.1.0",
"description": "",
"main": "./src/client.js",
"type": "module",
"type": "commonjs",
"module": "./src/client.js",
"scripts": {
"prod": "NODE_ENV=production pm2 start ecosystem.config.js",

View File

@ -1,4 +1,4 @@
import { runTests } from "./util/orchTester.js";
const { runTests } = require("./util/orchTester.js");
(async () => {
// On first boot, kickstart the test loop

View File

@ -1,12 +1,12 @@
import dns from "dns";
import geoip from "geoip-lite";
import { request, gql } from "graphql-request";
import https from "https";
import http from "http";
import grpc from "@grpc/grpc-js";
import protoLoader from "@grpc/proto-loader";
const dns = require("dns");
const geoip = require("geoip-lite");
const { request, gql } = require("graphql-request");
const https = require("https");
const http = require("http");
const grpc = require("@grpc/grpc-js");
const protoLoader = require("@grpc/proto-loader");
import {
const {
CONF_MASTER_PORT,
CONF_MASTER_DOMAIN,
CONF_MASTER_PATH,
@ -22,7 +22,7 @@ import {
CONF_DNS_TIMEOUT,
CONF_PRESHARED_MASTER_KEY,
CONF_SIGNATURE,
} from "../config.js";
} = require("../config.js");
/*
@ -378,4 +378,4 @@ const runTests = async function () {
}
};
export { runTests };
exports.runTests = runTests;

View File

@ -3,7 +3,7 @@ module.exports = {
{
name: "master-hodler",
script: "./src/master.js",
cwd: "/orchTest/master",
cwd: "/home/marco/repos/OrchestratorAvailability/master",
env_production: {
NODE_ENV: "production"
},

View File

@ -3,7 +3,7 @@
"version": "0.1.0",
"description": "",
"main": "./src/master.js",
"type": "module",
"type": "commonjs",
"module": "./src/master.js",
"scripts": {
"prod": "NODE_ENV=production pm2 start ecosystem.config.js",

View File

@ -1,8 +1,6 @@
import express from "express";
import { masterRouter } from "./routes/index.js";
import { CONF_MASTER_PORT } from "./config.js";
// Env variable which determines which DB to connect to
const { NODE_ENV: mode } = process.env;
const express = require("express");
const { masterRouter } = require("./routes/index.js");
const { CONF_MASTER_PORT } = require("./config.js");
(async () => {
try {

View File

@ -1,7 +1,7 @@
import express from "express";
import client from "prom-client";
import { JsonRpcProvider } from "ethers";
import {
const express = require("express");
const client = require("prom-client");
const { JsonRpcProvider } = require("ethers");
const {
CONF_API_L1_HTTP,
CONF_API_L1_KEY,
CONF_PRESHARED_MASTER_KEY,
@ -9,7 +9,7 @@ import {
CONF_KEY_EXPIRY,
CONF_SCORE_TIMEOUT,
CONF_SLEEPTIME,
} from "../config.js";
} = require("../config.js");
/*
@ -487,4 +487,4 @@ const runTests = async function () {
console.log("Starting watcher for test stream results");
runTests();
export default masterRouter;
exports.masterRouter = masterRouter;

View File

@ -1,2 +1,2 @@
import masterRouter from './hodler.js';
export { masterRouter };
const { masterRouter } = require("./hodler.js");
exports.masterRouter = masterRouter;