The mock you are usually making as one liner, but easy to re-use
299
This is a really small application used to mock server in very basic cases.
You can build this app from source or use prebuilt image from DockerHub.
Building from sources requires Go.
Clone git repository
git clone https://github.com/kuskoman/stupid-http-mock.git
Continue to directory
cd stupid-http-mock
Build repository
go build main.go
This should result with ready-to-use executable.
Simply use (Docker required)
docker run -p <host port>:<container port> kuskoman/stupid-http-mock:latest
for example:
docker run -p 1234:8080 kuskoman/stupid-http-mock:latest
will run app on host port 1234.
The application takes requests, responds with informations about request with status 200 OK and simply logs its properties.
Example of logs (after entering app url in browser using firefox with random user-agent plugin):
2020/10/19 15:30:29 Request received
URL: /
Method: GET
Host: localhost:8080
Body:
Headers:
Cookie: csrftoken=zukg4pEjcCjeQfi3QpvmFaNH288TPxgeau5h6HpQ0GMcHBboQg8VEr61oJk2quFH
Upgrade-Insecure-Requests: 1
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/86.0.4240.75 Safari/537.36
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8
Accept-Language: en-US,en;q=0.5
Accept-Encoding: gzip, deflate
Connection: keep-alive
Because I needed very simple mock server many times and I decided to create 'full' app, instead of short scripts every time it was needed.
Content type
Image
Digest
Size
6.4 MB
Last updated
almost 6 years ago
docker pull kuskoman/stupid-http-mock