This commit is contained in:
20
services/client/package.json
Normal file
20
services/client/package.json
Normal file
@@ -0,0 +1,20 @@
|
||||
{
|
||||
"name": "client",
|
||||
"version": "1.0.0",
|
||||
"private": true,
|
||||
"scripts": {
|
||||
"start": "react-scripts start",
|
||||
"build": "react-scripts build",
|
||||
"test": "react-scripts test --watchAll=false",
|
||||
"eject": "react-scripts eject"
|
||||
},
|
||||
"dependencies": {
|
||||
"react": "^18.0.0",
|
||||
"react-dom": "^18.0.0",
|
||||
"react-scripts": "5.0.1"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@testing-library/react": "^13.0.0",
|
||||
"jest": "^29.0.0"
|
||||
}
|
||||
}
|
||||
11
services/client/src/App.js
Normal file
11
services/client/src/App.js
Normal file
@@ -0,0 +1,11 @@
|
||||
import React from 'react';
|
||||
|
||||
function App() {
|
||||
return (
|
||||
<div>
|
||||
<h1>Hello, World!</h1>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
export default App;
|
||||
8
services/client/src/App.test.js
Normal file
8
services/client/src/App.test.js
Normal file
@@ -0,0 +1,8 @@
|
||||
import { render, screen } from '@testing-library/react';
|
||||
import App from './App';
|
||||
|
||||
test('renders Hello, World!', () => {
|
||||
render(<App />);
|
||||
const headingElement = screen.getByText(/Hello, World!/i);
|
||||
expect(headingElement).toBeInTheDocument();
|
||||
});
|
||||
10
services/game/app/__init__.py
Normal file
10
services/game/app/__init__.py
Normal file
@@ -0,0 +1,10 @@
|
||||
from flask import Flask
|
||||
|
||||
def create_app():
|
||||
app = Flask(__name__)
|
||||
|
||||
@app.route("/")
|
||||
def hello_world():
|
||||
return "Hello, World!"
|
||||
|
||||
return app
|
||||
4
services/game/app/config.py
Normal file
4
services/game/app/config.py
Normal file
@@ -0,0 +1,4 @@
|
||||
import os
|
||||
|
||||
class Config:
|
||||
SECRET_KEY = os.environ.get("SECRET_KEY", "default_secret_key")
|
||||
3
services/game/app/main.py
Normal file
3
services/game/app/main.py
Normal file
@@ -0,0 +1,3 @@
|
||||
from . import create_app
|
||||
|
||||
app = create_app()
|
||||
6
services/game/manage.py
Normal file
6
services/game/manage.py
Normal file
@@ -0,0 +1,6 @@
|
||||
from app import create_app
|
||||
|
||||
app = create_app()
|
||||
|
||||
if __name__ == "__main__":
|
||||
app.run()
|
||||
4
services/game/requirements.txt
Normal file
4
services/game/requirements.txt
Normal file
@@ -0,0 +1,4 @@
|
||||
Flask==2.2.2
|
||||
pytest==7.2.0
|
||||
gunicorn==20.1.0
|
||||
psycopg2-binary==2.9.6
|
||||
19
services/game/tests/test_app.py
Normal file
19
services/game/tests/test_app.py
Normal file
@@ -0,0 +1,19 @@
|
||||
import pytest
|
||||
from app import create_app
|
||||
|
||||
@pytest.fixture
|
||||
def app():
|
||||
app = create_app()
|
||||
app.config.update({
|
||||
"TESTING": True,
|
||||
})
|
||||
return app
|
||||
|
||||
@pytest.fixture
|
||||
def client(app):
|
||||
return app.test_client()
|
||||
|
||||
def test_hello_world(client):
|
||||
response = client.get("/")
|
||||
assert response.status_code == 200
|
||||
assert response.data == b"Hello, World!"
|
||||
Reference in New Issue
Block a user