A WEB API application that exposes a single client endpoint.
The endpoint returns a fancy string based on the input parameter (fancyNumber
):
-
- If the
fancyNumber
is a multiple of 3 - return "G",
- If the
-
- If the
fancyNumber
is a multiple of 5 - return "N",
- If the
-
- If the
fancyNumber
is a multiple of both 3 and 5 - return "GN";
- If the
-
- Otherwise return the provided
fancyNumber
.
- Otherwise return the provided
The application is not intended to be run publicly on production.
Run the following commands:
- Install dependencies:
npm install
; - Start application:
npm start
; The application is running onhttp://localhost:80
and contains a single endpoint:
- [GET]
http://localhost:80/{fancyNumber}
, wherefancyNumber
is an integer.
Swagger
is used to demonstrate the API documentation.
When application is running, visit http://localhost:80/api-docs
from your broser to view the documentation.
Run unit tests by command in console: npm test
.
- Web app framework - express
- API documentation - swagger ui
- Test framework - jest
- Requests validation - celebrate