Skip to content

Commit

Permalink
feat: Added STATUS endpoint for probe (#4)
Browse files Browse the repository at this point in the history
added status path
  • Loading branch information
diegolagospagopa authored Jan 25, 2023
1 parent 5d0a03e commit 02a754a
Show file tree
Hide file tree
Showing 5 changed files with 59 additions and 9 deletions.
10 changes: 10 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,4 +29,14 @@ With this json body (all fields are mandatory):

## Tests

### Thunder tests

Inside the folder thunder-tests you can find the collection with tests for Thunder extension

### Docker compose

To use docker compose for tests you can launch into the root folder this command (and force every time the docker build)

```sh
docker-compose up --build
```
9 changes: 9 additions & 0 deletions src/routes/status.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
const express = require("express");
const router = express.Router();

router.get("/", (req, res) => {
console.log("status -> ok")
res.status(200).send("ok")
});

module.exports = router;
2 changes: 2 additions & 0 deletions src/server.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ app.use(express.json());

// Routes
const availabilityRouter = require("./routes/availability");
const statusRouter = require("./routes/status");

app.get("/", (req, res) => {
console.log("Here");
Expand All @@ -16,6 +17,7 @@ app.get("/", (req, res) => {
});

app.use("/availability", availabilityRouter);
app.use("/status", statusRouter);

app.listen(PORT, HOST, () => {
console.log(`Running on http://${HOST}:${PORT}`);
Expand Down
17 changes: 16 additions & 1 deletion thunder-tests/thunderCollection.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,21 @@
"colName": "app-insights-ambassador",
"created": "2023-01-22T18:19:30.158Z",
"sortNum": 10000,
"folders": []
"folders": [
{
"_id": "963707bc-dd50-4f70-a0a8-f839db6573b4",
"name": "availability",
"containerId": "",
"created": "2023-01-25T19:28:37.659Z",
"sortNum": 10000
},
{
"_id": "f92b9fde-a3a6-4314-89cb-a2df0300b8e3",
"name": "status",
"containerId": "",
"created": "2023-01-25T19:28:49.427Z",
"sortNum": 20000
}
]
}
]
30 changes: 22 additions & 8 deletions thunder-tests/thunderclient.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@
{
"_id": "d7827e81-a36f-4054-ade2-36db4c560473",
"colId": "c1f6f91b-c276-4f00-b77e-04fa5665212b",
"containerId": "",
"containerId": "963707bc-dd50-4f70-a0a8-f839db6573b4",
"name": "add-availability",
"url": "http://localhost:3000/availability/add",
"method": "POST",
"sortNum": 10000,
"created": "2023-01-22T18:19:30.160Z",
"modified": "2023-01-22T21:21:20.944Z",
"modified": "2023-01-25T19:28:42.572Z",
"headers": [],
"params": [],
"body": {
Expand All @@ -21,13 +21,13 @@
{
"_id": "1a09c4d0-fe15-49bd-9d1e-c025c2438dce",
"colId": "c1f6f91b-c276-4f00-b77e-04fa5665212b",
"containerId": "",
"containerId": "963707bc-dd50-4f70-a0a8-f839db6573b4",
"name": "add-availability-success-fail",
"url": "http://localhost:3000/availability/add",
"method": "POST",
"sortNum": 15000,
"sortNum": 20000,
"created": "2023-01-22T18:19:30.161Z",
"modified": "2023-01-22T18:19:30.161Z",
"modified": "2023-01-25T19:28:43.863Z",
"headers": [],
"params": [],
"body": {
Expand All @@ -40,13 +40,13 @@
{
"_id": "8ab87a56-9d16-4f9d-a031-6014770627ce",
"colId": "c1f6f91b-c276-4f00-b77e-04fa5665212b",
"containerId": "",
"containerId": "963707bc-dd50-4f70-a0a8-f839db6573b4",
"name": "add-availability-wrong-attributes",
"url": "http://localhost:3000/availability/add",
"method": "POST",
"sortNum": 20000,
"sortNum": 30000,
"created": "2023-01-22T18:19:30.162Z",
"modified": "2023-01-22T18:19:30.162Z",
"modified": "2023-01-25T19:28:45.107Z",
"headers": [],
"params": [],
"body": {
Expand All @@ -55,5 +55,19 @@
"form": []
},
"tests": []
},
{
"_id": "d45347df-e727-4a1f-b97e-c82eee37b85f",
"colId": "c1f6f91b-c276-4f00-b77e-04fa5665212b",
"containerId": "f92b9fde-a3a6-4314-89cb-a2df0300b8e3",
"name": "status",
"url": "http://localhost:3000/status",
"method": "GET",
"sortNum": 40000,
"created": "2023-01-25T19:28:59.702Z",
"modified": "2023-01-25T19:29:14.474Z",
"headers": [],
"params": [],
"tests": []
}
]

0 comments on commit 02a754a

Please sign in to comment.