mirror of
https://github.com/supabase/supabase.git
synced 2026-07-04 21:24:22 +08:00
add Angular todo list source code add the example to the existing list on supabase.io add codeowners file for automated assignment fo reviews
24 lines
625 B
TypeScript
24 lines
625 B
TypeScript
import ErrnoException = NodeJS.ErrnoException
|
|
|
|
const { writeFile } = require('fs')
|
|
|
|
// Configure Angular `environment.ts` file path
|
|
const targetPath = './src/environments/environment.prod.ts'
|
|
|
|
// read environment variables from .env file
|
|
require('dotenv').config()
|
|
|
|
// `environment.ts` file structure
|
|
const envConfigFile = `export const environment = {
|
|
production: true,
|
|
supabaseUrl: '${process.env.ANGULAR_APP_SUPABASE_URL}',
|
|
supabaseKey: '${process.env.ANGULAR_APP_SUPABASE_KEY}'
|
|
};
|
|
`
|
|
|
|
writeFile(targetPath, envConfigFile, function (err: ErrnoException | null) {
|
|
if (err) {
|
|
throw console.error(err)
|
|
}
|
|
})
|