All Projects → svenstaro → dummyhttp

svenstaro / dummyhttp

Licence: MIT license
Super simple HTTP server that replies a fixed body with a fixed response code

Programming Languages

rust
11053 projects
Makefile
30231 projects
Dockerfile
14818 projects
shell
77523 projects

Projects that are alternatives of or similar to dummyhttp

Generator Http Fake Backend
Yeoman generator for building a fake backend by providing the content of JSON files or JavaScript objects through configurable routes.
Stars: ✭ 49 (+96%)
Mutual labels:  fake, mocking, http-server
Http Fake Backend
Build a fake backend by providing the content of JSON files or JavaScript objects through configurable routes.
Stars: ✭ 253 (+912%)
Mutual labels:  fake, mocking, http-server
Gock
HTTP traffic mocking and testing made easy in Go ༼ʘ̚ل͜ʘ̚༽
Stars: ✭ 1,185 (+4640%)
Mutual labels:  mocking, http-server
jaymock-cli
Mock an API and generate fake JSON test data, right from the terminal.
Stars: ✭ 13 (-48%)
Mutual labels:  fake, mocking
Mimesis
Mimesis is a high-performance fake data generator for Python, which provides data for a variety of purposes in a variety of languages.
Stars: ✭ 3,439 (+13656%)
Mutual labels:  fake, dummy
Mockaco
🐵 HTTP mock server, useful to stub services and simulate dynamic API responses, leveraging ASP.NET Core features, built-in fake data generation and pure C# scripting
Stars: ✭ 213 (+752%)
Mutual labels:  fake, mocking
DeepfakeHTTP
DeepfakeHTTP is a web server that uses HTTP dumps as a source for responses.
Stars: ✭ 373 (+1392%)
Mutual labels:  http-server, dummy
dummy-products-api
An api to fetch dummy e-commerce product 👕 👗 👖 👚 JSON data with placeholder images.
Stars: ✭ 102 (+308%)
Mutual labels:  fake, dummy
better-mock
Forked from Mockjs, Generate random data & Intercept ajax request. Support miniprogram.
Stars: ✭ 140 (+460%)
Mutual labels:  fake, mocking
Faker.js
generate massive amounts of realistic fake data in Node.js and the browser
Stars: ✭ 34,329 (+137216%)
Mutual labels:  fake, mocking
Ts Auto Mock
Typescript transformer to unlock automatic mock creation for interfaces and classes
Stars: ✭ 204 (+716%)
Mutual labels:  fake, mocking
Clj Fakes
An isolation framework for Clojure/ClojureScript.
Stars: ✭ 26 (+4%)
Mutual labels:  fake, mocking
Fake Xrm Easy
The testing framework for Dynamics CRM and Dynamics 365 which runs on an In-Memory context and deals with mocks or fakes for you
Stars: ✭ 216 (+764%)
Mutual labels:  fake, mocking
dummy
Run mock server based off an API contract with one command
Stars: ✭ 170 (+580%)
Mutual labels:  mocking, dummy
Funk
Funk is a HTTP server implementation of PHPSGI. Implemented the lightweight middlewares, responder components...
Stars: ✭ 16 (-36%)
Mutual labels:  http-server
open-api-mocker
A mock server based in OpenAPI Specification
Stars: ✭ 58 (+132%)
Mutual labels:  mocking
http
Extension module of golang http service
Stars: ✭ 57 (+128%)
Mutual labels:  http-server
Network-Learn
A cross-platform network learning demos. Like high-performance http server
Stars: ✭ 23 (-8%)
Mutual labels:  http-server
random
Random data generator AKA faker
Stars: ✭ 14 (-44%)
Mutual labels:  fake
FluentSimulator
A fluent syntax .NET REST/HTTP API simulator for automated unit and UI testing.
Stars: ✭ 23 (-8%)
Mutual labels:  mocking

dummyhttp

GitHub Actions Workflow Docker Cloud Build Status AUR Crates.io license Lines of Code

A super simple HTTP server that replies with a fixed body and a fixed response code

This is a simple, small, self-contained, cross-platform CLI tool for debugging and testing. It allows you to return arbitrary HTTP responses and log incoming request data. HTTP/2 support included.

How to use

Log all incoming request data

dummyhttp --verbose
curl -X POST localhost:8080 -d hi
# ┌─Incoming request
# │ POST / HTTP/1.1
# │ Accept: */*
# │ Content-Length: 2
# │ Host: localhost:8080
# │ User-Agent: curl/7.66.0
# │ Content-Type: application/x-www-form-urlencoded
# │ Body:
# hi

Example with color:

Pretty log

Running with no arguments always returns 200 on all interfaces at port 8080

dummyhttp
curl localhost:8080
# < HTTP/1.1 200 OK
# < content-length: 10
# < date: Sat, 09 Jun 2018 13:56:14 GMT
# <
# dummyhttp

Always emit 400 Bad Request

dummyhttp -c 400
curl localhost:8080
# < HTTP/1.1 400 Bad Request
# < content-length: 10
# < date: Sat, 09 Jun 2018 13:57:53 GMT
# <
# dummyhttp

Always return a certain string

dummyhttp -b "Hello World"
curl localhost:8080
# < HTTP/1.1 200 OK
# < content-length: 12
# < date: Sat, 09 Jun 2018 13:58:57 GMT
# <
# Hello World

Return a specific header

dummyhttp -b "Hello World" -H application/json
curl localhost:8080
# < HTTP/1.1 200 OK
# < content-length: 10
# < content-type: application/json
# < date: Thu, 14 Jun 2018 11:10:14 GMT
# <
# Hello World

How to install

On Linux: Download dummyhttp-linux-amd64 from the releases page and run

chmod +x dummyhttp-linux-amd64
./dummyhttp-linux-amd64

On macOS: Download dummyhttp-macos-amd64 from the releases page and run

chmod +x dummyhttp-macos-amd64
./dummyhttp-macos-amd64

On Windows: Download dummyhttp-windows-amd64.exe from the releases page and run

dummyhttp-windows-amd64.exe

With Cargo: If you have a somewhat recent version of Rust and Cargo installed, you can run

cargo install dummyhttp
dummyhttp

Full options

dummyhttp 0.4.3
Sven-Hendrik Haase <[email protected]>
Super simple HTTP server that replies with a fixed body and a fixed response code

USAGE:
    dummyhttp [FLAGS] [OPTIONS]

FLAGS:
        --help       Prints help information
    -q, --quiet      Be quiet (log nothing)
    -V, --version    Prints version information
    -v, --verbose    Be verbose (log data of incoming and outgoing requests)

OPTIONS:
    -b, --body <body>                   HTTP body to send [default: dummyhttp]
    -c, --code <code>                   HTTP status code to send [default: 200]
    -h, --headers <headers>...          Headers to send (format: key:value)
    -i, --interfaces <interfaces>...    Interface to bind to [default: 0.0.0.0]
    -p, --port <port>                   Port on which to listen [default: 8080]
        --cert <tls-cert>               TLS cert to use
        --key <tls-key>                 TLS key to use

Releasing

This is mostly a note for me on how to release this thing:

  • Update version in Cargo.toml and README.md
  • git commit and git tag -s, git push
  • Run cargo publish
  • Releases will be built and deployed automatically by GitHub Actions
  • Update AUR package
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].