Skip to content

Repository files navigation

SquadMakers Reto NodeJS - Jokes and Math API

This API provides a set of endpoints for jokes and math calculations.

ENDPOINTS

Joke

This endpoint provides jokes from different sources.

Get all jokes saved in DB

GET /jokes

#### Create a joke and save it to DB
```bash
POST /jokes

Get joke by number saved in DB

GET /jokes/{number}

Get a random joke

Returns a random joke from one of the following sources:

GET /jokes/random

Get a joke by type

Returns a joke from one of the following sources, based on the parameter type:
If the parameter type is "dad" will return a joke from this source:

GET /jokes/by-type/{type}

Update a joke

PUT /jokes/{number}

Delete a joke

DELETE /jokes/{number}

Math

This endpoint provides two mathematical endpoint to calculate the least common multiple of a list of numbers and an increment endpoint that will return the incremented number passed by query parameters .

GET /math/least-common-multiple?numbers=12&numbers=2&numbers=34&numbers=45
GET /math/increment?number=12

Pre-reqs

To build and run this app locally you will need a few things:

This api use postgresql from Docker and is ready for use without any additional configuration.

Getting started

  • Clone the repository
git clone --depth=1 https://github.com/Microsoft/TypeScript-Node-Starter.git <project_name>
  • Install dependencies
cd <project-name>
npm install
  • Build and run the project
docker-compose build 
docker-compose up

This command will start the project Finally, navigate to http://localhost:8888 and you should see the project being served and rendered locally!

Testing

npm run test 

About

Reto SquadMakers Api REST Node JS

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages