Skip to content

This Fibonacci service provides a RESTful API endpoint to calculate Fibonacci numbers.

License

Notifications You must be signed in to change notification settings

evandrosouza89/fibonacci-api

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Fibonacci Service

This Fibonacci service provides a RESTful API endpoint to calculate Fibonacci numbers.

Live demo

App screenshot

Check live demo on this link

Prerequisites

  • Java Development Kit (JDK) installed
  • Maven build tool installed
  • Docker installed (optional, for containerization)

Installation and Setup

  1. Clone this repository:

    git clone <repository_url>
  2. Navigate to the project directory:

    cd fibonacci-api
  3. Build the project using Maven:

    mvn clean install
  4. Run the application:

    java -jar target/fibonacci-api-0.0.1-SNAPSHOT.jar

    The service will start running on http://localhost:8080.

Usage

Calculate Fibonacci Number

To calculate the Fibonacci number for a given n, make a GET request to the /fib endpoint with the n query parameter.

Example request:

GET /fib?n=10

Example response:

55

Docker Support

You can also run the Fibonacci service using Docker. After building the project with Maven, create a Docker image:

docker build -t fibonacci-api .

Then run the Docker container:

docker run -p 8080:8080 fibonacci-service

The service will be accessible on http://localhost:8080.

License

This project is licensed under the MIT License.

About

This Fibonacci service provides a RESTful API endpoint to calculate Fibonacci numbers.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published