Remove config file for client, moved to .env

This commit is contained in:
Logan Cusano
2023-05-07 04:40:46 -04:00
parent e0b6e567c1
commit ed79403a9b
6 changed files with 54 additions and 45 deletions

View File

@@ -2,16 +2,18 @@
const { DebugBuilder } = require("../utilities/debugBuilder.js");
const log = new DebugBuilder("client", "httpRequests");
// Config
const config = require("../config/clientConfig");
require('dotenv').config();
// Modules
const http = require("http");
var runningClientConfig = new nodeObject({_id: process.env.CLIENT_ID, _ip: process.env.CLIENT_IP, _name: process.env.CLIENT_NAME, _port: process.env.CLIENT_PORT, _location: process.env.CLIENT_LOCATION, _nearbySystems: process.env.CLIENT_NEARBY_SYSTEMS, _online: process.env.CLIENT_ONLINE});
exports.requestOptions = class requestOptions {
constructor(path, method, hostname = undefined, headers = undefined, port = undefined) {
if (method === "POST"){
this.hostname = hostname ?? config.serverConfig.hostname
this.hostname = hostname ?? runningClientConfig.hostname
this.path = path
this.port = port ?? config.serverConfig.port
this.port = port ?? runningClientConfig.port
this.method = method
this.headers = headers ?? {
'Content-Type': 'application/json',