Skip to content

Instantly share code, notes, and snippets.

View silvio.md

POC KrakenD

Crie um arquivo chamado Dockerfile :

FROM devopsfaith/krakend

COPY krakend.json /etc/krakend/krakend.json

ENTRYPOINT [ "/usr/bin/krakend" ]

CMD [ "run", "-c", "/etc/krakend/krakend.json"]

View using_optic_auto_generate_oas.md

Using Optic to generate your API Specs

You might have some APIs that, for some reason, don't have their OAS/Swagger file. Well, this post will show how you could save yourself in scenarios like that.

You can download Optic from here: https://useoptic.com. What I will show here is pretty much a recipe to fully understand how to use that tool.

Mocking APIs using json-server

View clean_docker.sh
#!/bin/bash
clear
echo stopping docker
docker stop $(docker ps -aq)
echo removing all contianers
docker rm $(docker ps -aq)
View nginx_ingress.MD
helm repo add ingress-nginx https://kubernetes.github.io/ingress-nginx                  
helm repo update
helm install my-release ingress-nginx/ingress-nginx

Checando instalação

kubectl --namespace default get services -o wide -w my-release-ingress-nginx-controller

Fonte: https://kubernetes.github.io/ingress-nginx/deploy/

@edgars
edgars / adding.md
Last active Oct 22, 2020
post_docusaurus
View adding.md
$ yarn add @docusaurus/mdx-loader
$ yarn add swagger-ui-react
@edgars
edgars / swagger.yml
Created Oct 20, 2020
Livro_Jornada_Microservices
View swagger.yml
openapi: 3.0.2
info:
title: Jornada_Micro_Servicos
version: 1.0.0
description: API de Exemplo do Livro
paths:
/funcionarios:
summary: Path used to manage the list of funcionarios.
description: >-
The REST endpoint/path used to list and create zero or more `funcionario` entities. This path
View mapperidea-estudo.md

Passo 1

Na pasta descompactada do curso:

mapperidea/curso/helloworld

Entrar na pasta onde tem o mapa mental (arquivo mdm):

curso/helloworld/mapper/mdm

View exemplo.yaml
openapi: 3.0.2
info:
title: OperacoesBancarias
version: 1.0.0
description: API de Pagamento
paths:
/clientes:
summary: Path used to manage the list of clientes.
description: >-
The REST endpoint/path used to list and create zero or more `Clientes` entities. This path
@edgars
edgars / sequence-fault.xml
Created Aug 8, 2020
Handling-Errors-EI-API
View sequence-fault.xml
<?xml version="1.0" encoding="UTF-8"?>
<sequence name="sequence-fault" trace="disable" xmlns="http://ws.apache.org/ns/synapse">
<log level="full">
<property name="text" value="An unexpected error occured"/>
<property name="message" expression="get-property('ERROR_MESSAGE')"/>
</log>
<payloadFactory media-type="xml">
<format>
<error xmlns="">
<msg>$1</msg>
View krakend-traefik-cluster.yaml
version: "3.3"
services:
traefik:
image: "traefik:v2.2"
container_name: "traefik"
command:
- "--log.level=DEBUG"
- "--api.insecure=true"
- "--providers.docker=true"