Skip to content

Instantly share code, notes, and snippets.

<api xmlns="http://ws.apache.org/ns/synapse" name="ClimaAPI" context="/clima" hostname="localhost" port="8280">
<resource methods="GET" uri-template="/{country}/{city}">
<inSequence>
<log level="full"></log>
<payloadFactory media-type="xml">
<format>
<GetWeather xmlns="http://www.webserviceX.NET">
<CityName>$1</CityName>
<CountryName>$2</CountryName>
</GetWeather>
@edgars
edgars / gist:dc4226dc44360f0bde9e
Created July 8, 2015 19:10
tr_currencyconverter
<?xml version="1.0" encoding="UTF-8"?>
<proxy xmlns="http://ws.apache.org/ns/synapse"
name="tr_currencyconverter"
transports="vfs"
statistics="disable"
trace="disable"
startOnLoad="true">
<target>
<inSequence>
<log level="full"/>

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"]

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

#!/bin/bash
clear
echo stopping docker
docker stop $(docker ps -aq)
echo removing all contianers
docker rm $(docker ps -aq)
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 October 22, 2020 03:07
post_docusaurus
$ yarn add @docusaurus/mdx-loader
$ yarn add swagger-ui-react
<?xml version="1.0" encoding="UTF-8"?>
<api context="/os" name="OS" xmlns="http://ws.apache.org/ns/synapse">
<resource methods="POST" protocol="http" uri-template="/{country}/{id_ordem}">
<inSequence>
<property name="RESPONSE" value="true" scope="default"/>
<property name="NO_ENTITY_BODY" action="remove" scope="axis2"/>
<property name="HTTP_SC" value="401" scope="axis2"/>
<header name="To" action="remove"/>
<property name="ContentType" scope="axis2" type="STRING" value="text/xml"/>
<property name="messageType" scope="axis2" type="STRING" value="application/xml"/>
@edgars
edgars / swagger.yml
Created October 20, 2020 03:08
Livro_Jornada_Microservices
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

Passo 1

Na pasta descompactada do curso:

mapperidea/curso/helloworld

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

curso/helloworld/mapper/mdm