opentrader
Version:
OpenTrader is a powerful open-source crypto trading bot designated to automate your trading strategies on various cryptocurrency exchanges.
30 lines (26 loc) • 798 B
JavaScript
import { createRequire } from 'module';
import { getSettings } from './chunk-7GYOAC3Y.mjs';
import { Daemon } from './chunk-PNY4QK66.mjs';
import './chunk-SWPT4CTA.mjs';
createRequire(import.meta.url);
if (typeof globalThis.__dirname === "undefined") {
globalThis.__dirname = new URL('.', import.meta.url).pathname;
}
if (typeof globalThis.__filename === "undefined") {
globalThis.__filename = new URL(import.meta.url).pathname;
}
// src/api/up/daemon.ts
var { host, port } = getSettings();
var daemon = await Daemon.create({
server: {
frontendDistPath: "../frontend",
host,
port
}
});
async function shutdown() {
await daemon.shutdown();
process.exit(0);
}
process.on("SIGTERM", shutdown);
process.on("SIGINT", shutdown);