This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
echo "Tageando version..." | |
sh ./tag.sh | |
echo "Borrando container..." | |
docker stop challenge-api-server | |
docker rm challenge-api-server | |
echo "Borrando imagen..." | |
docker rmi challenge-api |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { v4 as uuidv4 } from 'uuid'; | |
const register = (server, options) => { | |
server.ext({ | |
type: 'onRequest', | |
method: (request, h) => { | |
request.id = request.headers['x-request-id']||uuidv4(); | |
return h.continue; | |
} | |
}); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const cls = require('cls-hooked'); | |
const { v4: uuidV4 } = require('uuid'); | |
// generate a unique value for namespace | |
const name = 'settle-context'; | |
const nsId = `${name}:${uuidV4()}`; | |
const ns = cls.createNamespace(nsId); | |
const correlationIdKey = 'x-correlation-id'; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
let route_list = {}; | |
function print (path, layer) { | |
if (layer.route) { | |
layer.route.stack.forEach(print.bind(null, path.concat(split(layer.route.path)))) | |
} else if (layer.name === 'router' && layer.handle.stack) { | |
layer.handle.stack.forEach(print.bind(null, path.concat(split(layer.regexp)))) | |
} else if (layer.method) { | |
const pathRoute = `${layer.method.toUpperCase()} - ${path.concat(split(layer.regexp)).filter(Boolean).join('/')}`; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Receive an | |
const flatArray = (key,list)=>{ | |
let obj={}; | |
list.forEach((item,i)=>{ | |
obj[`${key}.${i}`]=item; | |
}); | |
return obj; |
OlderNewer