Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Flask Server Integration for Nomic Game #9

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# ignore file for poetry / python / flash project
#

# Ignore the poetry cache
__pycache__/

# Ignore the poetry virtual environment
.venv/
44 changes: 43 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1 +1,43 @@
# stf-nomic-game
# stf-nomic-game

## Installation

### Setting Up Poetry

To install the dependencies for this project, you will need to have Poetry installed. You can install Poetry by running the following command:

```
curl -sSL https://install.python-poetry.org | python3 -
```

### Installing Dependencies

To install the dependencies for this project, run the following command:

```
poetry install
```

### Activating the Virtual Environment

To activate the virtual environment created by Poetry, run the following command:

```
poetry shell
```

### Running the Flask Server

To start the Flask server, run the following command:

```
flask run
```

### Test the API

To test the API, you can use the following command:

```
curl http://localhost:5000/game
```
6 changes: 6 additions & 0 deletions app/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
from flask import Flask

app = Flask(__name__)
app.config['DEBUG'] = True

from . import routes
9 changes: 9 additions & 0 deletions app/routes.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
from . import app

@app.route('/')
def home():
return '<h1>Welcome to the Nomic Game!</h1><p>Embark on a journey where the rules of the game are decided by the players themselves.</p>'

@app.route('/game')
def game():
return '<h1>Game functionalities coming soon!</h1>'
178 changes: 178 additions & 0 deletions poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

16 changes: 16 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
[tool.poetry]
name = "stf-nomic-game"
version = "0.1.0"
description = ""
authors = ["Your Name <[email protected]>"]
readme = "README.md"
package-mode = false

[tool.poetry.dependencies]
python = "^3.10"
Flask = "^3.0.3"


[build-system]
requires = ["poetry-core"]
build-backend = "poetry.core.masonry.api"