An open API service indexing awesome lists of open source software.

https://github.com/zebrajaeger/dummy-http-server

Http Server to show incoming requests.
https://github.com/zebrajaeger/dummy-http-server

Last synced: about 2 months ago
JSON representation

Http Server to show incoming requests.

Awesome Lists containing this project

README

        

# Dummy http server
[![License: LGPL v3](https://img.shields.io/badge/License-GPL%20v3-blue.svg)](https://www.gnu.org/licenses/gpl-3.0)
[![npm version](https://badge.fury.io/js/%40zebrajaeger%2Fdummy-http-server.svg)](https://www.npmjs.com/@zebrajaeger/dummy-http-server)

Logs incoming requests (GET,POST,...) to console and returns 200.

## Installation

npm install -g @zebrajaeger/dummy-http-server

## Start

Exec

dhs

or

dummy-http-server

into terminal.

Default port is 2999.
change ist wit -p or --port option:

dhs -p 1234

## Stop

Press ctrl + C within console window.

### Use

Make a request with a browser:

http://localhost:2999

The console log may look like this one:

headers: { host: 'localhost:2999',
connection: 'keep-alive',
'upgrade-insecure-requests': '1',
'user-agent':
'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/79.0.3945.130 Safari/537.36',
'sec-fetch-user': '?1',
accept:
'text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.9',
'sec-fetch-site': 'none',
'sec-fetch-mode': 'navigate',
'accept-encoding': 'gzip, deflate, br',
'accept-language': 'de-DE,de;q=0.9,en;q=0.8',
cookie: 'io=6MrMv9kVc25N62FEAAA1' }
cookies: { io: '6MrMv9kVc25N62FEAAA1' }
body: {}