Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/sablierapp/mimic
Mimic is a configurable web-server for testing purposes.
https://github.com/sablierapp/mimic
Last synced: about 2 months ago
JSON representation
Mimic is a configurable web-server for testing purposes.
- Host: GitHub
- URL: https://github.com/sablierapp/mimic
- Owner: sablierapp
- License: gpl-3.0
- Created: 2024-10-21T17:37:36.000Z (2 months ago)
- Default Branch: main
- Last Pushed: 2024-10-23T03:39:36.000Z (2 months ago)
- Last Synced: 2024-10-24T16:21:54.258Z (2 months ago)
- Language: Go
- Size: 38.1 KB
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Mimic
Mimic is a configurable web-server with a configurable behavior.
## Usage
```bash
mimic
2024/10/21 15:35:15 Application is starting... Should start in 2 seconds.
2024/10/21 15:35:17 Starting up on port 80 (started in 2 seconds)
``````bash
curl -v http://localhost:8080
* Host localhost:8080 was resolved.
* IPv6: ::1
* IPv4: 127.0.0.1
* Trying [::1]:8080...
* Connected to localhost (::1) port 8080
> GET / HTTP/1.1
> Host: localhost:8080
> User-Agent: curl/8.5.0
> Accept: */*
>
< HTTP/1.1 200 OK
< Content-Type: text/plain; charset=utf-8
< Date: Mon, 21 Oct 2024 20:04:59 GMT
< Content-Length: 17
<
* Connection #0 to host localhost left intact
Mimic says hello!
```## Configuration
```bash
mimic --help
Usage of mimic:
-exit-code int
The exit code of the application.
-healthy
If the application should be healthy. (default true)
-healthy-after duration
The duration after which the application will serve 200 to the /health endpoint. (default 10s)
-port string
Server listening port (default "80")
-running
If the application should be running. If set to false, the application will exit. (default true)
-running-after duration
The duration after which the application will serve content. (default 2s)
```