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: about 2 months 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 (over 8 years ago)
- Default Branch: master
- Last Pushed: 2019-03-10T23:43:26.000Z (over 7 years ago)
- Last Synced: 2025-10-06T21:48:36.538Z (9 months ago)
- Topics: api, docker, golang, rest, serverless
- Language: Go
- Size: 30.3 KB
- Stars: 2
- Watchers: 1
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# rester-tester [](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