apiVersion: v1
kind: ConfigMap
metadata:
  name: caddy-config
  namespace: default
data:
  Caddyfile: |
    learn.hasura.io {
      tls {
        dns cloudflare
      }
      redir 301 {
        /graphql/react/boilerplate.zip https://graphql-engine-cdn.hasura.io/learn-hasura/boilerplates/react/react-boilerplate.zip
      }

      redir 301 {
        /graphql/react-native/boilerplate.zip https://graphql-engine-cdn.hasura.io/learn-hasura/boilerplates/react-native/react-native-boilerplate.zip
      }

      redir 301 {
        /graphql/vue/boilerplate.zip https://graphql-engine-cdn.hasura.io/learn-hasura/boilerplates/vue/vue-boilerplate.zip
      }

      redir 301 {
        /graphql/ios/boilerplate.zip https://graphql-engine-cdn.hasura.io/learn-hasura/boilerplates/ios/ios-boilerplate.zip
      }

      redir 301 {
        /graphql/android/boilerplate.zip https://graphql-engine-cdn.hasura.io/learn-hasura/boilerplates/android/android-boilerplate.zip
      }

      redir 301 {
        /graphql/elm/elm-boilerplate.zip https://graphql-engine-cdn.hasura.io/learn-hasura/boilerplates/elm/elm-boilerplate.zip
      }

      redir 301 {
        /graphql/reason-react-apollo/boilerplate.zip https://graphql-engine-cdn.hasura.io/learn-hasura/boilerplates/reason-react-apollo/boilerplate.zip
      }

      redir 301 {
        /graphql/reason-react-apollo/ /graphql/reason-react-apollo/introduction
      }

      redir 301 {
        /graphql/elm-graphql/ /graphql/elm-graphql/introduction
      }

      redir 301 {
        /graphql/react-native/ /graphql/react-native/introduction
      }

      redir 301 {
        /graphql/react/ /graphql/react/introduction
      }

      redir 301 {
        /graphql/vue/ /graphql/vue/introduction
      }

      redir 301 {
        /graphql/ios/ /graphql/ios/introduction
      }

      redir 301 {
        /graphql/android/ /graphql/android/introduction
      }

      redir 301 {
        /graphql/hasura/ /graphql/hasura/introduction
      }

      proxy / homepage

      proxy /auth/webhook auth-webhook {
        without /auth
      }

      proxy /auth auth-jwt-server {
        without /auth
      }

      proxy /graphql/console hasura/console {
        without /graphql/console
      }

      proxy /graphql/v1alpha1/graphql hasura/v1alpha1/graphql {
        without /graphql/v1alpha1/graphql
        websocket
      }

      proxy /graphql/v1/graphql hasura/v1/graphql {
        without /graphql/v1/graphql
        websocket
      }

      proxy /graphql/v1/query hasura/v1/query {
        without /graphql/v1/query
      }

      proxy /graphql/v1/version hasura/v1/version {
        without /graphql/v1/version
      }

      proxy /graphql/graphiql graphiql {
        without /graphql/graphiql
      }

      proxy /graphql/hasura hasura-backend

      proxy /graphql/react-native react-native-apollo

      proxy /graphql/react react-apollo

      proxy /graphql/vue vue-apollo

      proxy /graphql/ios ios-apollo

      proxy /graphql/android android-apollo

      proxy /graphql/elm-graphql elm-graphql

      proxy /graphql/reason-react-apollo reason-react-apollo

      proxy /graphql hasura/v1/graphql {
        without /graphql
        websocket
      }
    }
