<?xml version="1.0" encoding="utf-8" standalone="yes" ?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
  <channel>
    <title>SlashQuery /?</title>
    <link>https://slashquery.com/</link>
    <description>Recent content on SlashQuery /?</description>
    <generator>Hugo -- gohugo.io</generator>
    <language>en-us</language>
    <lastBuildDate>Sat, 03 Jun 2017 09:58:25 +0200</lastBuildDate>
    
	<atom:link href="https://slashquery.com/index.xml" rel="self" type="application/rss+xml" />
    
    
    <item>
      <title>Microservices using an API Gateway.</title>
      <link>https://slashquery.com/post/microservices-using-an-api-gateway/</link>
      <pubDate>Sat, 03 Jun 2017 09:58:25 +0200</pubDate>
      
      <guid>https://slashquery.com/post/microservices-using-an-api-gateway/</guid>
      <description>The big picture:
(slashquery API Gateway) api.example.com/&amp;lt;path endpoint&amp;gt; | (plugins) (upstream) (microservices) | /home | /* &amp;gt;--[middleware]---[LoadBalancer]--&amp;lt; /home | /home | | /foo | /foo/* &amp;gt;--[middleware]---[LoadBalancer]--&amp;lt; /foo | /foo | | /foo-version-2 (versioning) | /foo/* &amp;gt;--[middleware]---[LoadBalancer]--&amp;lt; /foo-version-2 | /foo-version-2 | | /bar ` /bar/* &amp;gt;--[middleware]---[LoadBalancer]--&amp;lt; /bar /bar   More about versioning: https://violetear.org/post/versioning/
 The configuration file in YAML format:
config: host: ~ # listen all IP&#39;s port: 80 resolver: 8.</description>
    </item>
    
    <item>
      <title>Build your API Gateway</title>
      <link>https://slashquery.com/post/build-your-api-gateway/</link>
      <pubDate>Sat, 03 Jun 2017 09:57:24 +0200</pubDate>
      
      <guid>https://slashquery.com/post/build-your-api-gateway/</guid>
      <description>Because of the plugins (middleware) is not possible to have a generic binary, therefore after creating the configuration file and based on the plugins defined the gateway needs to be build.
Setup Setup go environment https://golang.org/doc/install
 go &amp;gt;= 1.7 is required
 For example using $HOME/go for your workspace
export GOPATH=$HOME/go  Create the directory:
mkdir -p $HOME/go/src/github.com/slashquery  Clone project into that directory:
git clone git@github.com:slashquery/slashquery.git $HOME/go/src/github.com/slashquery/slashquery  Create your configuration file and type make CONFIG=/path/to/slashquery.</description>
    </item>
    
    <item>
      <title>The configuration file</title>
      <link>https://slashquery.com/post/slashquery-yaml/</link>
      <pubDate>Sat, 03 Jun 2017 09:57:23 +0200</pubDate>
      
      <guid>https://slashquery.com/post/slashquery-yaml/</guid>
      <description>The configuration file is composed of 3 sections:
 config routes upstreams plugins  Example:
config: socket: /tmp/slashquery.sock routes: get: path: /get upstream: httpbin methods: - GET plugins: - waf upstream: httpbin: timeout: 5 servers: - httpbin.org plugins: waf: [&amp;quot;github.com/slashquery-plugins/waf&amp;quot;, &amp;quot;waf.WAF&amp;quot;]  The config allow the following options:
 debug host port request-id resolver socket  </description>
    </item>
    
    <item>
      <title>Plugins</title>
      <link>https://slashquery.com/post/plugins/</link>
      <pubDate>Sat, 03 Jun 2017 09:56:24 +0200</pubDate>
      
      <guid>https://slashquery.com/post/plugins/</guid>
      <description>Plugins are handlers that satisfy the http.Handler.
They are declared in the routes section of the configuration file for example:
routes: foo: url: http://foo.example.com plugins: # the order of the plugins meters - requestid - waf - cors - prometheus plugins: cors: [&amp;quot;github.com/slashquery-plugins/cors&amp;quot;, &amp;quot;cors.CORS&amp;quot;] csrf: [&amp;quot;github.com/slashquery-plugins/csrf&amp;quot;, &amp;quot;csrf.CSRF&amp;quot;] prometheus: [&amp;quot;github.com/slashquery-plugins/prometheus&amp;quot;, &amp;quot;prometheus.Prometheus&amp;quot;] requestid: [&amp;quot;github.com/slashquery-plugins/requestid&amp;quot;, &amp;quot;requestid.RequestID&amp;quot;] waf: [&amp;quot;github.com/slashquery-plugins/waf&amp;quot;, &amp;quot;waf.WAF&amp;quot;]  The plugins section is a list of plugins each of one defined within a list, for example:</description>
    </item>
    
    <item>
      <title>Using Nginx and slashquery through unix socket</title>
      <link>https://slashquery.com/post/nginx-and-slashquery-through-unix-socket/</link>
      <pubDate>Sat, 03 Jun 2017 09:56:23 +0200</pubDate>
      
      <guid>https://slashquery.com/post/nginx-and-slashquery-through-unix-socket/</guid>
      <description>Nginx configuration:
upstream slashquery { server unix:/tmp/slashquery.sock; keepalive 60; } server { listen 80 default_server; listen [::]:80 default_server; server_name _; location / { proxy_pass http://slashquery; proxy_http_version 1.1; # for keep-alive proxy_redirect off; proxy_set_header Host $http_host; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_set_header X-Real-IP $remote_addr; } }  SlashQuery configuration:
config: socket: /tmp/slashquery.sock ...  When socket is defined host and port are ignored.</description>
    </item>
    
    <item>
      <title>SlashQuery /?</title>
      <link>https://slashquery.com/about/</link>
      <pubDate>Sun, 21 May 2017 22:52:45 +0200</pubDate>
      
      <guid>https://slashquery.com/about/</guid>
      <description> What is slashquery ? A pluggable API Gateway
In a nutshell is an HTTP reverse proxy that pre-processes the requests before they arrive at their final destination based on custom plugins.
Some features:
 Single binary. Loads configuration from a YAML file. Allows the use of 3rd party handlers (plugins) that satisfy the http.Handler. DNS resolver honoring TTL from the upstream. Load balancer (round robin). Versioning Accept: application/vnd.* Accept or reject(405) based on HTTP Request Methods  </description>
    </item>
    
  </channel>
</rss>