diff --git a/.github/workflows/pruebaDeploy.yml b/.github/workflows/pruebaDeploy.yml index bfe8470..bf02c18 100644 --- a/.github/workflows/pruebaDeploy.yml +++ b/.github/workflows/pruebaDeploy.yml @@ -69,4 +69,4 @@ jobs: MONGO_URI: ${{secrets.MONGO_URI}} CLOUDINARY_NAME: ${{secrets.CLOUD_NAME}} CLOUDINARY_API_KEY: ${{secrets.CLOUD_KEY}} - CLOUDINARY_API_SECRET: ${{secrets.CLOUD_SECRET}} + CLOUDINARY_API_SECRET: ${{secrets.CLOUD_SECRET}} \ No newline at end of file diff --git a/restapi/modules/cloudinary.ts b/restapi/modules/cloudinary.ts index 6cd9e67..cb921f5 100644 --- a/restapi/modules/cloudinary.ts +++ b/restapi/modules/cloudinary.ts @@ -1,23 +1,27 @@ const cloudinary = require('cloudinary').v2; require('dotenv').config() -/* +var name: string = process.env.CLOUDINARY_NAME || 'name' +var api_key:string = process.env.CLOUDINARY_API_KEY || 'key' +var secret:string = process.env.CLOUDINARY_API_SECRET || 'secret' + export function config(){ cloudinary.config({ - cloud_name : process.env.CLOUDINARY_NAME, - api_key : process.env.CLOUDINARY_API_KEY, - api_secret: process.env.CLOUDINARY_API_SECRET + cloud_name : name, + api_key : api_key, + api_secret: secret }); -}*/ +} +/* export function config(){ cloudinary.config({ cloud_name : 'dypp8pt31', api_key : '321597164512969', api_secret: 'sM2uhnqaS53Sq9_HsPDLK63FS7I' }); -} +}*/ export function configTest(){ diff --git a/restapi/modules/gestorDB.ts b/restapi/modules/gestorDB.ts index ec7e961..db0173b 100644 --- a/restapi/modules/gestorDB.ts +++ b/restapi/modules/gestorDB.ts @@ -2,8 +2,10 @@ const mongoose = require('mongoose') require('dotenv').config() +const mongo_uri:string = process.env.MONGO_URI || 'localhost' + export function connect(){ - mongoose.connect(process.env.MONGO_URI, { + mongoose.connect(mongo_uri, { useNewUrlParser: true, useUnifiedTopology: true })