Giter VIP home page Giter VIP logo

higherorlowerbackend's Introduction

Higher or Lower Game Backend

This repository contains the backend for a "Higher or Lower" game. The backend is implemented using Node.js. The backend provides multiple endpoints to manage game rounds, players, and their scores.

Usage

Once the server is running, you can interact with the backend using the provided API endpoints.

API Endpoints

Endpoint Method Description Example Body (for POST)
/round GET Get the current round. Returns an error if the game hasn't started or has ended. N/A
/players GET Get a list of all players. N/A
/reset GET Clear all players and reset the game. N/A
/playersRound GET Get the current round and the list of players. Returns an error if the game has ended. N/A
/addPlayer/:name POST Add a new player with the specified name. Returns an error if the game has started or the name is already used. { "name": "PlayerName" }
/admin/nextRound POST Move to the next round or start the game. Returns an error if the game has ended. N/A
/submitAnswer/:playerName/:ans POST Submit an answer for a player. Updates the player's score if the answer is correct. { "ans": "Answer" }
/position/:playerName GET Get the position of a player and the top three players. Returns an error if the player is not found. N/A

Dependencies

  • Node.js
  • Express.js

Environment Variables

  • PORT: The port on which the server will run.

Install dependencies

```bash
npm install
```

Start the server

```bash
npm run dev
```

Developers

  • Peter Metcalfe

higherorlowerbackend's People

Contributors

peterm-13 avatar

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.