this-oliver / hash-server

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Hash-Server

This project is purely for educational purposes. It is not intended to be used in production.

The purpose of this project is to play around with Virtual Machines and, more specifically, Docker.

Installation

pre-requisites:

# install pnpm
npm install -g pnpm

# install dependencies
pnpm install

Getting Started

# build docker image

docker build -t hash-server .

## - `-t` is the tag name for the image
## - `.` is the path to the Dockerfile

# run the docker image in a container

docker run -p 3000:3000 -d hash-server

## - `-p` is the port mapping
## - `-d` is detached mode (runs container in the background)

Usage

The server exposes two endpoints:

Method Path Parameters Description
POST /hash sample Returns a SHA256 hash
POST /compare sample, hash Returns a boolean if the hash matches the sample

About


Languages

Language:TypeScript 91.9%Language:Dockerfile 8.1%