DevTareq / Mars

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Mars Time

Installation

  • Make sure you have Docker and Composer installed
  • Go to the project root directory
  • Run composer install
  • Run docker-compose build
  • Run docker-compose up -d
  • Go to http://localhost:8081 since we are exposing port 8081

API

1) Service Health Check

  • GET /time/health-check
  • Response
    • Code: Ok, 200
    • Body:
    {
        "message": "I am alive!"
    }
    

2) Mars Timing

  • GET /time/mars/{time}
  • Request
  • Response
    • Success
      • Code: Ok, 200
      • Body:
        {
            "Earth": {
                "Milli": <xxxxxxxxxxxxx> Milliseconds DateTime
            },
            "Mars": {
                "MSD": <xxx.yyy> Float Number,
                "MTC": <hh:mm:ss> Time Format
            }
         }
        
    • Fail
      • Code: Bad Request, 400
      • Body:
               {
                    "source": "<Response Source>",
                    "errors": [
                       <Error Message>
                    ]
               }
      

Test

  • Unit Test
    • Run ./vendor/bin/phpunit tests/Unit
  • Functional Test
    • Run ./vendor/bin/phpunit tests/Functional
  • General
    • Run ./vendor/bin/phpunit tests

About


Languages

Language:PHP 97.0%Language:Dockerfile 3.0%