Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: upgraded the methods for Copilot using pieces-copilot-sdk #138

20 changes: 18 additions & 2 deletions src/platform.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,27 @@ import { PiecesClient } from "pieces-copilot-sdk";
let BASE_URL: string;
let WS_URL: string;

// Define your port here
// Define your port based on the operating system
let PORT: number;

// Define your port here
// LINUX PORT=5323
// For Windows and MacOs PORT=1000
VishalPawar1010 marked this conversation as resolved.
Show resolved Hide resolved

const PORT = 5323
const platform = navigator.platform.toLowerCase();
console.log("OS TYPE IS: ",platform)
VishalPawar1010 marked this conversation as resolved.
Show resolved Hide resolved

const userAgent = navigator.userAgent.toLowerCase();
VishalPawar1010 marked this conversation as resolved.
Show resolved Hide resolved

if (platform.includes('win')) {
PORT = 1000;
} else if (platform.includes('mac')) {
PORT = 1000;
} else if (platform.includes('linux')) {
PORT = 5323;
} else {
console.log("PORT not set for : ",platform)
}
VishalPawar1010 marked this conversation as resolved.
Show resolved Hide resolved

BASE_URL = 'http://localhost:'+PORT;
WS_URL = 'ws://localhost:'+PORT;
Expand Down
Loading