Giter Club home page Giter Club logo

capston-project's Introduction

capston-project

A dice game ReST API that just saves the game for now. There are tests written to show how the calls work. The backend is written in typescript node.js and uses a mongo database.

Running the app

To run the cd into the folder and run npm run serve

In a new window run mongod

Running tests

In a new window run npm run test

You can also write your own calls to see how the api works for yourself.

How the app works

You can build a new game, with 2-6 players, and then add new players to a local game.

building a new game

Make a POST XMLHttpRequest with the url http://localhost:3000/create_game The body of the request is a json object containing

{'name': String, 'type': GameType, playerCount: Number}

Name is the name of the game.

Type is the type of game being played. (game type is an enum where 0=local, and 1=online. Online games are not set up yet)

playerCount is the number of players. (you can have between 2 and 6 players)

add players to a local game

Make a POST XMLHttpRequest with the url http://localhost:3000/add_local_player The body of the request is a json object containing

{'game': String, 'player': String, 'computer'?: Boolean}

game is the name of the local game you want to add the player to.

player is the name of the player.

computer is an optional boolean to specify if a player is a computer, but computer players are not supported yet.

capston-project's People

Contributors

jtjlehi avatar

Watchers

James Cloos 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.