GithubHelp home page GithubHelp logo

endouble's Introduction

Endouble Assignment Project

This project serves on Lumen micro framwork 5.8v. for http request i used GuzzleHttp packag.

Instalation and run project

After you clone this project, in terminal go to the project folder and run this command for installing dependencies with the composer:

composer update

copy .env.example as .env file:

cp .env.example .env

To running the project, run this command in the terminal (you most to have php on your machine) :

php -S localhost:8000 -t public

Now the project can be accessible on http://localhost:8000/api

or laravel valet can be used.

##Modules

For register new module you should create new php class and implements from ApiInterface and overwrite the get method. after that in Api/Api.php you should register your new module 'id' in switch case section.

the exist modules are SpaceX and Xkcd under the app\Api folder.

Request

The /api url with Get method is exist for handling our request. for example : http:localhost:8080/api

For testing api, PostMan or web browsers can be used.

Parametrs

Params Description
sourceId Required - value most one of : space , comics , comic
limit Not Required - only for space and comics sourceId - value most to be integer
year Not Required - only for space and comics sourceId - value most integer like: '2018'
id Not Required - only for comic sourceId - velue most be a integer

if the sourceId wasn't exists or if it's null, the application automatically returns ApiExseption error with 400 response code.

Tests

The test files is in /tests folder. SpaceTest,XkcdTest and ApiTest . For running the test, if you have phpunit on your machine run that in the project root. if you haven't, then install as global with composer with this command:

composer global require phpunit/phpunit

Now you can access to phpunit alias.

endouble's People

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.