Giter VIP home page Giter VIP logo

styx's Introduction

Styx

Пример использования сервиса:

Для начала нужно поднять сервис с помощью docker-compose.yml

У сервиса есть только один REST - POST "/v2/proxy", который принимает тело запроса следующего вида:

url - проксируемое api
httpMethod - один из HTTP методов
timeout - таймаут между запросами. Не обязательный параметр, дефолтное значение - 0
context - объекты вида key/value. На данный момент можно использовать только ключи headers/content. Под каждым ключом 
нужно указать value.
header value - Map<string, string>
content value - объект в виде base64, который будет декодирован исходя из указанного в value headers значения Content-Type
{
    "url": "https://someapi.com/",
    "httpMethod": "POST",
    "timeout": 2000
    "context": [
        {
            "key": "headers",
            "value": {
                "custom": "custom_value",
                "Accept-Language": "en_US",
                "Content-Type": "application/json"
            }
        },
        {
            "key": "content",
            "value": "base64string"       
        }
    ]
}

Пример запроса

Запрос:
{
    "url": "https://catfact.ninja/fact",
    "httpMethod": "GET"
}

В ответ придет:

{
    "code": 0,
    "originalStatus": 200,
    "url": "https://catfact.ninja/fact",
    "httpMethod": "GET",
    "body": {
        "fact": "A happy cat holds her tail high and steady.",
        "length": 43
    }
}

code - код системы Styx (0 - все ок, отрицательные коды означают различного рода ошибки, 
например при коде -1 придет ответ корректного формата, но по каким-то причинам не проксированный)

originalStatus - HTTP статус ответа вызванного сервиса

url - url запроса

httpMethod - выбранный HTTP метод

body - ответ от запрошенного сервиса

styx's People

Contributors

sagefreke avatar vitaxa avatar renovate[bot] avatar

styx's Issues

Dependency Dashboard

This issue lists Renovate updates and detected dependencies. Read the Dependency Dashboard docs to learn more.

Open

These updates have all been created already. Click a checkbox below to force a retry/rebase of any.

Detected dependencies

docker-compose
docker-compose.yml
github-actions
.github/workflows/build.yml
  • crashteamdev/jvm-workflows v1
.github/workflows/deploy.yml
  • crashteamdev/jvm-workflows v1
maven
pom.xml
  • dev.crashteam:service-parent-pom 1.0.7
  • com.github.loki4j:loki-logback-appender 1.3.2
  • org.codehaus.janino:janino 3.1.7
  • net.javacrumbs.shedlock:shedlock-provider-redis-spring 4.41.0
  • net.javacrumbs.shedlock:shedlock-spring 4.41.0
  • org.apache.maven.plugins:maven-remote-resources-plugin 1.6.0
  • org.apache.maven.shared:maven-filtering 1.3

  • Check this box to trigger a request for Renovate to run again on this repository

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.