@jaredwray/mockhttp
TypeScript icon, indicating that this package has built-in type declarations

0.2.1 • Public • Published

public/logo.svg

tests GitHub license codecov npm npm Docker Pulls

A simple HTTP server that can be used to mock HTTP responses for testing purposes. Inspired by httpbin and built using nodejs and fastify with the idea of running it via https://mockhttp.org, via docker jaredwray/mockhttp, or nodejs npm install jaredwray/mockhttp.

Deploy via Docker

docker run -d -p 3000:3000 jaredwray/mockhttp

Deploy via NodeJS

npm install @jaredwray/mockhttp --save

then run mockhttp in your code.

import { mockhttp } from '@jaredwray/mockhttp';
mockhttp.start(); // start the server
const response = await fetch('http://localhost:8080/ip');
mockhttp.stop(); // stop the server

About mockhttp.org

mockhttp.org is a free service that runs this codebase and allows you to use it for testing purposes. It is a simple way to mock HTTP responses for testing purposes. It is globally available has some limitations on it to prevent abuse but many people will not see it. It is ran via Cloudflare and Google Cloud Run across 7 regions globally.

Contributing

Please read our CODE OF CONDUCT and CONTRIBUTING for details on our code of conduct, and the process for submitting pull requests to us.

License

MIT License & © Jared Wray

Readme

Keywords

Package Sidebar

Install

npm i @jaredwray/mockhttp

Weekly Downloads

6

Version

0.2.1

License

MIT

Unpacked Size

71.1 kB

Total Files

8

Last publish

Collaborators

  • jaredwray