Skip to main content

A HTTP server that will return a status code of your choice

Project description

[![Build Status](https://travis-ci.org/wtsi-hgi/http-status-puppet.svg?branch=master)](https://travis-ci.org/wtsi-hgi/http-status-puppet)
[![codecov](https://codecov.io/gh/wtsi-hgi/http-status-puppet/branch/master/graph/badge.svg)](https://codecov.io/gh/wtsi-hgi/http-status-puppet)
[![PyPI version](https://badge.fury.io/py/httpstatuspuppet.svg)](https://badge.fury.io/py/httpstatuspuppet)

# HTTP Status Puppet
_A HTTP server that will return a status code of your choice_


## Introduction
This server simply returns back a status code depending on what endpoint is contacted, e.g.
```
$ curl -s -o /dev/null -w "%{http_code}" http://0.0.0.0:8000/403
403
$ curl -s -o /dev/null -w "%{http_code}" http://0.0.0.0:8000/200
200
```


## Installation
Prerequisites
- Python 3.6+

The tool can be installed from PyPi:
```bash
pip install httpstatuspuppet
```

Bleeding edge versions can be installed directly from GitHub:
```bash
pip install git+https://github.com/wtsi-hgi/http-status-puppet/.git@master#egg=httpstatuspuppet
```


## Usage
_Warning: this server was only designed for use in testing!_

### Local
After installing dependencies, in the project directory:
```bash
PYTHONPATH=. python httpstatuspuppet/entrypoint.py
```

### Docker
```bash
docker run -d -p ${HOST_PORT}:8000 mercury/http-status-puppet
```


## Alternatives
- C# server: https://github.com/Readify/httpstatus.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

httpstatuspuppet-1.0.0.tar.gz (4.6 kB view details)

Uploaded Source

File details

Details for the file httpstatuspuppet-1.0.0.tar.gz.

File metadata

File hashes

Hashes for httpstatuspuppet-1.0.0.tar.gz
Algorithm Hash digest
SHA256 6bd210c570848494e66a80a22dab96c30ee1f0a102739041e296f8c55e32e9cd
MD5 0bc8490151d2f652f63d00adb5e1e42d
BLAKE2b-256 b1c6ccc91c37e426c5e0f8f73cb8b18bbad1d0813c88df52ed7497a5843f49fc

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page