Giter Club home page Giter Club logo

cards's Introduction

Description

Card Deck basic API

Methods Supported

1. Create a deck of cards

POST /deck/create

Examples:

stretched & shuffled deck:

$ curl --location --request POST 'localhost:3333/deck/create' \
--header 'Content-Type: application/json' \
--data-raw '{ "type": "SHORT", "shuffled": true }
'

full & unshuffled deck:

$ curl --location --request POST 'localhost:3333/deck/create' \
--header 'Content-Type: application/json' \
--data-raw '{ "type": "FULL", "shuffled": false }
'

2. Open a deck

GET  /deck/open

Examples:

Open deck with deckId 00112233-4455-6677-8899-aabbccddeeff

$ curl --location --request GET 'localhost:3333/deck/open/00112233-4455-6677-8899-aabbccddeeff'

3. Draw from a deck

PUT  /deck/draw

Examples:

Draw 7 cards from deck with deckId 00112233-4455-6677-8899-aabbccddeeff

$ curl --location --request PUT 'localhost:3333/deck/draw/00112233-4455-6677-8899-aabbccddeeff' \
--header 'Content-Type: application/json' \
--data-raw '{
    "count": 7
}'

Installation & Prepare environment

NB! Docker, yarn & npm should be already installed on your machine

First of all

$ yarn install

To run service DEV mode:

$ yarn run db:dev:up
$ yarn run db:dev:migrate
$ yarn run start

To test service:

$ yarn run test

To test e2e:

$ yarn run test:e2e

To see test coverage:

$ yarn run test:cov

To stop DB containers:

$ yarn db:test:rm
$ yarn db:dev:rm

Creator

Alexander Konovalov

Built with NestJS

Nest Logo

cards's People

Contributors

alexkonovalov avatar

Watchers

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