mirror of
https://github.com/usebruno/bruno.git
synced 2024-11-22 07:53:34 +01:00
64 lines
1.1 KiB
Plaintext
64 lines
1.1 KiB
Plaintext
meta {
|
|
name: ping
|
|
type: http
|
|
seq: 1
|
|
}
|
|
|
|
get {
|
|
url: {{host}}/ping
|
|
body: none
|
|
auth: none
|
|
}
|
|
|
|
auth:awsv4 {
|
|
accessKeyId: a
|
|
secretAccessKey: b
|
|
sessionToken: c
|
|
service: d
|
|
region: e
|
|
profileName: f
|
|
}
|
|
|
|
vars:pre-request {
|
|
m4: true
|
|
pong: pong
|
|
}
|
|
|
|
assert {
|
|
res.status: eq 200
|
|
~res.body: eq {{pong}}
|
|
}
|
|
|
|
script:pre-request {
|
|
console.log(bru.getEnvName());
|
|
}
|
|
|
|
tests {
|
|
test("should ping pong", function() {
|
|
const data = res.getBody();
|
|
expect(data).to.equal(bru.getVar("pong"));
|
|
});
|
|
}
|
|
|
|
docs {
|
|
# API Documentation
|
|
|
|
## Introduction
|
|
|
|
Welcome to the API documentation for [Your API Name]. This document provides instructions on how to make requests to the API and covers available authentication methods.
|
|
|
|
## Authentication
|
|
|
|
Before making requests to the API, you need to authenticate your application. [Your API Name] supports the following authentication methods:
|
|
|
|
### API Key
|
|
|
|
To use API key authentication, include your API key in the request headers as follows:
|
|
|
|
```http
|
|
GET /api/endpoint
|
|
Host: api.example.com
|
|
Authorization: Bearer YOUR_API_KEY
|
|
|
|
}
|