traverse1984 / an-extremely-simple-http-server

An extremely simple HTTP server

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Highlander Battery

This extremely simple http server allows you to start a timer and then check the progress of the timer, simulating a battery.

Usage

First, run the build.sh to build the docker container. You can then make run the container with run.sh.

  • Send a POST request to start (or re-start) the battery timer;
  • Send a GET request to see the current status.

API

All responses have the following format:

{
   status: boolean,
   message: string,
}

A successful status request has the following additional keys:

{
   timeRemaining: number, // int
   percentageRemaining: number, // float
   percentageRemainingString: string, // format: "x%"
}

About

An extremely simple HTTP server


Languages

Language:TypeScript 82.5%Language:Dockerfile 10.9%Language:Shell 6.6%