Skip to content

taybart/rest

Folders and files

NameName
Last commit message
Last commit date

Latest commit

9d803f6 · Apr 10, 2025
Apr 23, 2022
Apr 10, 2025
Apr 12, 2023
Apr 10, 2025
Apr 10, 2025
Apr 23, 2022
Dec 11, 2023
Apr 12, 2023
Apr 10, 2025
Apr 10, 2025
Apr 23, 2022

Repository files navigation

Rest

Goes well with rest.nvim

Example:

locals {
  url = "http://localhost:8080"
  asdf = "world"
}

// test
request "hell_yeah" {
  method = "GET"
  headers = [
    "X-TEST: you:😄",
  ]
  url = "${locals.url}/get"
}

request "my_post" {
  method = "POST"
  url = "${locals.url}/post"
  headers = [
    "Content-Type: application/json",
  ]

  body = <<END
  {
    "hello": "${locals.asdf}"
  }
  END
  expect = 200
}

Server/Client:

image

Testing:

image

rest -h
    --no-color, -nc:
        No colors
    --quiet, -q:
        Minimize logging
    --addr, -a:
        Address to listen on
    --serve, -s:
        Run a server
    --dir, -d:
        Directory to serve
    --file, -f:
        File to run
    --block, -b:
        Request block to run
    --label, -l:
        Request label to run