AhmadElsagheer / simpleserver

A simple http server that receives any request and logs it to stdout

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

simpleserver

A simple http server that receives any request and logs it to stdout.

Installation

go install github.com/ahmadelsagheer/simpleserver@latest

Usage

  1. Start server
simpleserver -p 8000
  1. Send a request
# GET request
curl http://localhost:8000
# POST request
curl -X POST --data '{"hello": "world"}' http://localhost:8000

You can use it with ngrok as follows:

  1. Start both simple and ngrok servers
# terminal 1
simpleserver -p 8000
# terminal 2
ngrok http 8000
  1. Send a request (from any machine)
curl https://<NGROK_FORWARDING_URL>

About

A simple http server that receives any request and logs it to stdout


Languages

Language:Go 100.0%