/dice-api

Just a silly API built with nothing but Node.js.

Primary LanguageTypeScript

Dice API

Just a silly API to simulate a dice roll.

Usage

To use it, make a GET request with the number of sides in the URL.

Example: http://localhost:5555/d4

It can be used to simulate multiple dices:

  • d4: to simulate a dice with 4 sides;
  • d6: 6 sides;
  • d8: 8 sides;
  • d10: 10 sides;
  • d12: 12 sides;
  • d20: 20 sides;

About

The objective was to build a simple API using nothing but Node.js, no Express or other framework.

Setup

Simply clone the repository, navigate to the folder, install the dependecies with npm install and acces it with an API client (Insomnia, Postman) on http://localhost:5555/:dice