Skip to content

Commit

Permalink
Creación de variables en string
Browse files Browse the repository at this point in the history
  • Loading branch information
UO271728 committed May 2, 2022
1 parent ab3924e commit 6e10cb3
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 8 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/pruebaDeploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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}}
16 changes: 10 additions & 6 deletions restapi/modules/cloudinary.ts
Original file line number Diff line number Diff line change
@@ -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(){
Expand Down
4 changes: 3 additions & 1 deletion restapi/modules/gestorDB.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
})
Expand Down

0 comments on commit 6e10cb3

Please sign in to comment.