Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/mchmarny/rester-tester
Rest server to test serverless usage patterns
https://github.com/mchmarny/rester-tester
api docker golang rest serverless
Last synced: 5 days ago
JSON representation
Rest server to test serverless usage patterns
- Host: GitHub
- URL: https://github.com/mchmarny/rester-tester
- Owner: mchmarny
- License: apache-2.0
- Created: 2018-01-27T20:13:12.000Z (almost 7 years ago)
- Default Branch: master
- Last Pushed: 2019-03-10T23:43:26.000Z (over 5 years ago)
- Last Synced: 2024-06-20T02:53:05.925Z (5 months ago)
- Topics: api, docker, golang, rest, serverless
- Language: Go
- Size: 30.3 KB
- Stars: 2
- Watchers: 3
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# rester-tester [![Build Status](https://travis-ci.org/mchmarny/rester-tester.svg?branch=master)](https://travis-ci.org/mchmarny/rester-tester)
Simple REST server to test serverless usage patterns
## Run
#### Dependancies
```
make deps
```#### Locally
```
make run
```#### Locally in Docker
```
docker build -t rester-tester .
docker run -p 8080:8080 rester-tester:latest
```## Use
### Ping
Basic GET test##### Request
```
curl http://localhost:8080/ping
```##### Response
```
{
"pong": {
"service_id": "1f6f4f35-1ef5-4c27-b69c-b34652544229",
"host_name": "056504ae4039",
"started_at": "2018-01-28 18:22:32.383411901 +0000 UTC"
}
}
```### Prime
Basic max prime number calculator##### Request
To get max prime using defaults
```
curl http://localhost:8080/prime
```To pass max number as argument to prime calculator
```
curl http://localhost:8080/prime/50000000
```##### Response
```
{
"prime": {
"max": 50000000,
"host_name": "056504ae4039",
"val": 49999991
}
}
```### Image
Makes PNG thumbnail from video URL. Will test whether the app can execute external ffmpeg command.
```
curl -X POST -H "Content-Type: application/json" http://localhost:8080/image \
-d '{"src":"https://www.youtube.com/watch?v=DjByja9ejTQ"}'
``````
{
"request_id":"b8845f04-c462-4f3e-91d7-6d512c576e23",
"created_at":"2018-01-28 18:25:06.475802091 +0000 UTC",
"status":"Processed",
"req": {
"src":"https://www.youtube.com/watch?v=DjByja9ejTQ",
"width":200,
"height":200
},
"message":"Completed in 1.016136195s",
"thumb/img_8acd94cd-4035-4c62-b4d7-d6c6cb03a88d.png"
}
```## TODO
* Push images to distributed object store