I hereby claim:
- I am zerooneit on github.
- I am diegoresendez (https://keybase.io/diegoresendez) on keybase.
- I have a public key whose fingerprint is 6DC2 D76B 4858 1E5B 9971 C894 C35C 5796 264E FD3E
To claim this, I am signing this object:
I hereby claim:
To claim this, I am signing this object:
export async function createResource(req,res) { | |
try { | |
// cuando utilizar await y cuando no ? | |
/* Siempre que requieras un valor de una funcion async o await y que tu resultado no dependa de esa llamada*/ | |
// processResource puede tomar 2 o 3 minutos por eso creo que no deberia tener await | |
// para no tener esperando la respuesta del endpoint hasta que termine | |
/* processResource debes usar await, ya que creo que tu resultado depende de esa funcion, no importa cuanto tome al final si dependes | |
mostrar el resultado en resourceId, deberias refactorizar processResource de otro modo nodejs y express siempre entregara un undefined*/ | |
import JWT from '@core/classes/JWT'; | |
import { JWT_AUDIENCE, JWT_HEADER, JWT_ISSUER, JWT_SECRET } from '@core/constants'; | |
import * as mongoose from 'mongoose'; | |
import { ExtractJwt, Strategy } from 'passport-jwt'; | |
export default async function jwt(passport) { | |
const User = mongoose.model('User'); | |
const options = { | |
audience: JWT_AUDIENCE, | |
ignoreExpiration: true, |
scope.$on('someEvent', function(e, data){ | |
/** | |
* Make sure to send information to the view without use $apply | |
* | |
**/ | |
scope.$evalAsync(function(){ | |
scope.model = data; | |
}); | |
} |
###After Install Nginx
After Install Nginx need to configure the files to add proxy to nginx
cd /etc/nginx/sites-available/
vim test
In the file you need to paste the next code.