zoukankan      html  css  js  c++  java
  • restql 学习一 安装试用

    restql 提供了manager 可以方便配置restql 的资源,同时也提供了一个docker-compose 运行环境
    以下是一个安装使用

    环境准备

    • docker-compose 文件
     
    version: '3'
    services:
      restql-api:
        image: b2wdigital/restql-http:latest
        ports:
          - "9000:9000"
        environment:
          - MONGO_URL=mongodb://mongodb:27017/restql
      restql-manager:
        image: b2wdigital/restql-manager:latest
        ports:
          - "3000:3000"
        environment:
          - MONGO_URL=mongodb://mongodb:27017/restql
          - RESTQL_SERVER_URL=http://restql-api:9000
      mongodb:
        image: mongo:latest
        ports: 
        - "27017:27017"

    启动&&测试

    • 启动
    docker-compose  up -d


    配置信息

    • 一个简单查询


    保存信息

    • 执行查询

    UI 界面


    curl 模拟
    即席查询方式

    curl --request POST 
         --url "http://localhost:9000/run-query" 
         --header 'content-type: text/plain' 
         --data 'from launches with flight_number = 18'
    {"launches":{"details":{"success":true,"status":200,"metadata":{}},"result":{"launch_date_unix":1411278720,"mission_name":"CRS-4","crew":null,"launch_success":true,"mission_id":["EE86F74"],"is_tentative":false,"launch_window":0,"launch_site":{"site_name_long":"Cape Canaveral Air Force Station Space Launch Complex 40","site_name":"CCAFS SLC 40","site_id":"ccafs_slc_40"},"upcoming":false,"tbd":false,"details":null

    使用保存的查询

    curl --request GET 
         --url "http://localhost:9000/run-query/spacex/get-launch/1?number=18"
    {"launches":{"details":{"success":true,"status":200,"metadata":{}},"result":{"launch_date_unix":1411278720,"mission_name":"CRS-4","crew":null,"launch_success":true,"mission_id":["EE86F74"],"is_tentative":false,"launch_window":0,"launch_site":{"site_name_long":"Cape Canaveral Air Force Station Space Launch Complex 40","site_name"

    说明

    以上是一个简单基本环境安装以及查询学习,后边详细学习查询语法的处理

    参考资料

    https://github.com/B2W-BIT/restQL-http/tree/master/examples/api-and-manager
    http://docs.restql.b2w.io/

  • 相关阅读:
    JVM——什么是JIT编译器?
    JVM——HotSpot虚拟机常用垃圾收集器参数
    MUI——按钮样式
    MUI——MUI左滑删除、MUI右滑删除、MUI左右滑删除
    JQuery——事件绑定bind和on的区别
    cnblogs美化——在博客文章插入“可运行"js代码
    mysql的一次错误处理
    Composer的使用
    php 实现收藏功能
    在sublime text3 上使用HTML-CSS-JS PRETTY 插件
  • 原文地址:https://www.cnblogs.com/rongfengliang/p/11874448.html
Copyright © 2011-2022 走看看