Skip to content

restfql/ktor-restfql

Repository files navigation

LogoMakr-0suVuk Ktor RestFQL

Motivation

RestFQL for ktor is a rest middleware that implements the specification.

In short RestFQL allows filtering of response driven by the querying side without breaking caching and keeping the capability for the backend to do optimizations as required.

Usage

  1. Add repository if not use the version on maven central
repositories {
    ...
    maven {
        url = uri("https://maven.pkg.github.com/restfql/ktor-restfql")
        credentials {
            username = project.findProperty("gpr.user") as String? ?: System.getenv("GITHUB_ACTOR")
            password = project.findProperty("gpr.key") as String? ?: System.getenv("GITHUB_TOKEN")
        }
    }
}
  1. install with a package manager
val restfql_version = "1.0.0"

dependencies {
    implementation("com.restfql:ktor-restfql:$restfql_version")
}
  1. Add the middleware to your ktor server
package com.restfql.ktor.example

import com.restfql.ktor.RestFQL
import io.ktor.server.application.*
import io.ktor.server.netty.*
import com.restfql.ktor.example.plugins.*

fun main(args: Array<String>) {
    EngineMain.main(args)
}

fun Application.module() {
    ...
    install(RestFQL)
}
  1. query passing the model as a query param call fql

preview query

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Languages