Fix main process detect, refine lock, remove axios

This commit is contained in:
Wildan M 2023-04-24 05:51:47 +07:00
commit 07de2fab78
8 changed files with 87 additions and 190 deletions

View file

@ -1,12 +1,11 @@
import { config } from "dotenv";
import http from "http";
import listener from "./src/client.js";
import { fileURLToPath } from "url";
import { isMainProcess } from "./src/util.js";
// development endpoint (use ngrok)
const server = http.createServer(listener);
if (process.argv[1] === fileURLToPath(import.meta.url)) {
if (isMainProcess(import.meta.url)) {
config();
const port = parseInt(process.env.HTTP_PORT || "3000");
server.listen(port, function () {