node-ui / create-env.js
srijan9994's picture
create env test
d529a1b
raw
history blame contribute delete
642 Bytes
const fs = require('fs');
// Log the environment variables
console.log('REACT_APP_GOOGLE_CLIENT_ID:', process.env.REACT_APP_GOOGLE_CLIENT_ID);
console.log('REACT_APP_FLASK_API_URL:', process.env.REACT_APP_FLASK_API_URL);
// Construct the content of the .env file
const envContent = `
REACT_APP_GOOGLE_CLIENT_ID=${process.env.REACT_APP_GOOGLE_CLIENT_ID}
REACT_APP_FLASK_API_URL=${process.env.REACT_APP_FLASK_API_URL}
`;
// Write the content to the .env file
fs.writeFileSync('.env', envContent, (err) => {
if (err) {
console.error('Error writing .env file', err);
} else {
console.log('.env file created successfully');
}
});