diff options
| author | Thomas Grothe <grothe.tr@gmail.com> | 2026-02-22 22:53:29 -0500 |
|---|---|---|
| committer | Thomas Grothe <grothe.tr@gmail.com> | 2026-02-22 22:53:29 -0500 |
| commit | cb35c8e69f1645a298542c75d26c4dcb744f0c2c (patch) | |
| tree | 042d296db2f932a60a5236a1939209147d7ec0ae /server_readme.md | |
| parent | f3d75ecf1e6006b2ab669a37dd73a5c7b03c4739 (diff) | |
Diffstat (limited to 'server_readme.md')
| -rwxr-xr-x | server_readme.md | 124 |
1 files changed, 0 insertions, 124 deletions
diff --git a/server_readme.md b/server_readme.md deleted file mode 100755 index 604c398..0000000 --- a/server_readme.md +++ /dev/null @@ -1,124 +0,0 @@ -# Flask Web Server for Simple Website
-
-This is a simple, expandable Flask web server designed to serve a static website with HTML, CSS, and JavaScript files. The server is designed to be easily expanded with new routes and functionality.
-
-## Setup Instructions
-
-### Prerequisites
-- Python 3.6 or higher
-- pip (Python package manager)
-
-### Installation
-
-1. Install required packages:
- ```
- pip install -r requirements.txt
- ```
-
-### Running the Server
-
-1. Start the Flask development server:
- ```
- python app.py
- ```
-
-2. Access the website at [http://localhost:5000](http://localhost:5000)
-
-## Project Structure
-
-- `app.py` - The main Flask application
-- `requirements.txt` - Python dependencies
-- `index.html` - Main HTML file
-- `css/` - CSS stylesheets
-- `js/` - JavaScript files
-
-## How to Expand the Server
-
-### Adding New Routes
-
-To add a new page or API endpoint, add a route to `app.py`:
-
-```python
-@app.route('/new-page')
-def new_page():
- return send_from_directory('.', 'new-page.html')
-```
-
-### Adding API Endpoints
-
-For JSON APIs, add a route that returns a JSON response:
-
-```python
-@app.route('/api/data')
-def api_data():
- data = {
- 'key': 'value',
- 'items': [1, 2, 3]
- }
- return jsonify(data)
-```
-
-### Adding Database Support
-
-To add a database, you can use Flask-SQLAlchemy:
-
-1. Install Flask-SQLAlchemy:
- ```
- pip install Flask-SQLAlchemy
- ```
-
-2. Update your `app.py` to include database configuration:
- ```python
- from flask_sqlalchemy import SQLAlchemy
-
- app.config['SQLALCHEMY_DATABASE_URI'] = 'sqlite:///site.db'
- db = SQLAlchemy(app)
-
- class User(db.Model):
- id = db.Column(db.Integer, primary_key=True)
- username = db.Column(db.String(80), unique=True, nullable=False)
- ```
-
-### Adding User Authentication
-
-For user authentication, you can use Flask-Login:
-
-1. Install Flask-Login:
- ```
- pip install Flask-Login
- ```
-
-2. Configure it in your application:
- ```python
- from flask_login import LoginManager, UserMixin
-
- login_manager = LoginManager(app)
- login_manager.login_view = 'login'
- ```
-
-### Environment Variables
-
-The server passes environment variables to the frontend. To add new environment variables:
-
-1. Update the `get_env_vars()` function in `app.py`:
- ```python
- def get_env_vars():
- return {
- 'thing': 1,
- 'apiUrl': 'http://api.example.com',
- 'newVariable': 'value'
- }
- ```
-
-## Production Deployment
-
-For production deployment, consider:
-
-1. Using a WSGI server like Gunicorn:
- ```
- pip install gunicorn
- gunicorn -w 4 -b 0.0.0.0:5000 app:app
- ```
-
-2. Setting up a proper web server like Nginx as a reverse proxy
-3. Setting environment variables for production configuration
|
