Giter Site home page Giter Site logo

bingo-backend-lumen-laravel's Introduction

play bingo with nodejs

requires PHP 8.0
git clone https://github.com/cpajuelodeveloper/bingo-backend-lumen-laravel.git

set enviroment

mv env.example .env

install dependencies

composer install

run tests

./vendor/bin/phpunit

start local server

php -S localhost:3000 -t public

Go to the browser and open localhost:3000 and complete with the following urls.

[GET]

take card [/bingo/cards/take]

  • Response 200 (application/json)
    {
        "cardNumber": 1,
        "card": [
            [
                11,
                15,
                4,
                2,
                1
            ],
            [
                18,
                20,
                23,
                25,
                30
            ],
            [
                35,
                44,
                "FREE",
                38,
                43
            ],
            [
                56,
                60,
                49,
                48,
                52
            ],
            [
                68,
                64,
                73,
                74,
                75
            ]
        ]
    }

[GET]

call number[/bingo/call]

  • Response 200 (application/json)
    {
        "call": 20,
        "calls": [
            44,
            28,
            31,
            14,
            73,
            70,
            54,
            20
        ]
    }

[GET]

check winner by card [/bingo/cards/check/1]

  • Response 200 (application/json)
    {
        "cardNumber": 1,
        "winner": true,
        "options": [[14,5,9,3,11],[17,16,24,19,26],[37,31,"FREE",39,36],[49,53,57,48,58],[68,71,61,66,69]]
    }
    
    //error response
    { "error": "card not set"}
    

[GET]

check all winners [/bingo/cards/check-all]

  • Response 200 (application/json)
    [{
        "cardNumber": 1,
        "winner": true,
        "options": [[14,5,9,3,11],[17,16,24,19,26],[37,31,"FREE",39,36],[49,53,57,48,58],[68,71,61,66,69]]
    },
    {
        "cardNumber": 2,
        "winner": true,
        "options": [[14,5,9,3,11],[17,16,24,19,26],[37,31,"FREE",39,36],[49,53,57,48,58],[68,71,61,66,69]]
    }]
    
    //errors response
    { "error": "cards not set"}

[GET]

reset game [/bingo/reset]

  • Response 200 (application/json)
    {
        "success": true,
        "message": "game reset"
    }
    
    //errors response
    {
        "success": false,
        "message": "game already reset"
    }

bingo-backend-lumen-laravel's People

Contributors

cpajuelodeveloper avatar

Stargazers

Roman 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.