Skip to main content
Glama

Github Project Manager

copy-env-to-dist.js1.3 kB
#!/usr/bin/env node /** * Script to copy the .env file to the dist folder during build */ import fs from "fs"; import path from "path"; import { fileURLToPath } from "url"; // Get the directory of the current module const __dirname = path.dirname(fileURLToPath(import.meta.url)); const rootDir = path.resolve(__dirname, ".."); const envPath = path.join(rootDir, ".env"); const envExamplePath = path.join(rootDir, ".env.example"); const distDir = path.join(rootDir, "dist"); /** * Copy the .env file to the dist folder */ function copyEnvToDist() { console.log("Copying environment files to dist folder..."); // Create dist directory if it doesn't exist if (!fs.existsSync(distDir)) { fs.mkdirSync(distDir, { recursive: true }); } // Copy .env file if it exists if (fs.existsSync(envPath)) { fs.copyFileSync(envPath, path.join(distDir, ".env")); console.log("✅ Copied .env file to dist folder"); } else { console.log("⚠️ No .env file found in project root"); // If .env doesn't exist but .env.example does, copy that instead if (fs.existsSync(envExamplePath)) { fs.copyFileSync(envExamplePath, path.join(distDir, ".env.example")); console.log("✅ Copied .env.example file to dist folder"); } } } // Run the script copyEnvToDist();

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/Monsoft-Solutions/model-context-protocols'

If you have feedback or need assistance with the MCP directory API, please join our Discord server