small
This commit is contained in:
@@ -5,7 +5,7 @@ from .api import api_bp
|
||||
def create_app():
|
||||
app = Flask(__name__)
|
||||
app.config.from_object(Config)
|
||||
|
||||
|
||||
app.register_blueprint(api_bp, url_prefix='/api')
|
||||
|
||||
@app.route('/favicon.ico')
|
||||
@@ -19,6 +19,11 @@ def create_app():
|
||||
response.headers['Cache-Control'] = f'public, max-age={max_age}'
|
||||
return response
|
||||
|
||||
@app.after_request
|
||||
def remove_content_disposition(response):
|
||||
response.headers.pop('Content-Disposition', None)
|
||||
return response
|
||||
|
||||
@app.route('/')
|
||||
def index():
|
||||
template_vars = {
|
||||
@@ -30,5 +35,5 @@ def create_app():
|
||||
@app.route('/api/health')
|
||||
def health():
|
||||
return {'status': 'OK'}
|
||||
|
||||
|
||||
return app
|
||||
|
||||
@@ -1,2 +1,2 @@
|
||||
#!/bin/sh
|
||||
exec gunicorn -w 4 -b 0.0.0.0:5000 'app:create_app()'
|
||||
exec gunicorn -c gunicorn.conf.py --no-control-socket -w 4 -b 0.0.0.0:5000 'app:create_app()'
|
||||
|
||||
10
gunicorn.conf.py
Normal file
10
gunicorn.conf.py
Normal file
@@ -0,0 +1,10 @@
|
||||
from gunicorn.http import wsgi
|
||||
from functools import wraps
|
||||
|
||||
def wrap_default_headers(func):
|
||||
@wraps(func)
|
||||
def default_headers(*args, **kwargs):
|
||||
return [h for h in func(*args, **kwargs) if not h.startswith('Server:')]
|
||||
return default_headers
|
||||
|
||||
wsgi.Response.default_headers = wrap_default_headers(wsgi.Response.default_headers)
|
||||
@@ -5,3 +5,4 @@ python-dotenv==1.0.1
|
||||
werkzeug==3.0.4
|
||||
gunicorn
|
||||
cssutils
|
||||
flask-static-digest
|
||||
@@ -22,7 +22,7 @@
|
||||
.drop-zone {
|
||||
cursor: pointer;
|
||||
transition: all 0.2s;
|
||||
min-height: 280px;
|
||||
min-height: 200px;
|
||||
}
|
||||
|
||||
.drop-zone:hover {
|
||||
|
||||
@@ -99,17 +99,16 @@ document.addEventListener("DOMContentLoaded", () => {
|
||||
<small><code>${escapeHtml(data.original ?? "")}</code> → <strong>${sizeKB}KB</strong></small>
|
||||
</div>
|
||||
</div>
|
||||
<div class="btn-group-vertical btn-group-sm">
|
||||
<div class="btn-group-sm d-flex flex-column gap-2">
|
||||
<button class="btn btn-success btn-copy-sm" type="button">
|
||||
<i class="fa-solid fa-copy me-1"></i>Copy
|
||||
<i class="fa-solid fa-copy me-1"></i>Copy
|
||||
</button>
|
||||
<a
|
||||
href="data:text/html;charset=utf-8,${encodeURIComponent(rawHtml)}"
|
||||
download="aio.html"
|
||||
class="btn btn-outline-primary btn-sm"
|
||||
>
|
||||
<i class="fa-solid fa-download me-1"></i>Save
|
||||
<a href="data:text/html;charset=utf-8,${encodeURIComponent(rawHtml)}"
|
||||
download="aio.html"
|
||||
class="btn btn-outline-primary btn-sm">
|
||||
<i class="fa-solid fa-download me-1"></i>Save
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -43,13 +43,13 @@
|
||||
|
||||
<!-- Mode Buttons -->
|
||||
<div class="mode-wrap mb-5">
|
||||
<button class="btn btn-outline-primary btn-lg mode-btn" data-mode="basic" type="button">
|
||||
<button class="btn btn-outline-primary btn-lg mode-btn active" data-mode="basic" type="button">
|
||||
<i class="fa-solid fa-bolt fa-2x"></i>
|
||||
<div class="fw-semibold">Basic</div>
|
||||
<small class="text-muted">Fast - for small sites</small>
|
||||
</button>
|
||||
|
||||
<button class="btn btn-outline-primary btn-lg mode-btn active" data-mode="advanced" type="button">
|
||||
<button class="btn btn-outline-primary btn-lg mode-btn" data-mode="advanced" type="button">
|
||||
<i class="fa-solid fa-gears fa-2x"></i>
|
||||
<div class="fw-semibold">Advanced</div>
|
||||
<small class="text-muted">CSS chains - multiple css/js files</small>
|
||||
@@ -57,12 +57,12 @@
|
||||
</div>
|
||||
|
||||
<!-- Drop Zone -->
|
||||
<div id="drop-zone" class="drop-zone card border border-2 border-light rounded-4 p-5 mb-4 text-center">
|
||||
<i class="fa-solid fa-cloud-arrow-up fa-4x text-muted mb-4"></i>
|
||||
<div id="drop-zone" class="drop-zone card border border-2 border-light rounded-4 p-4 mb-4 text-center">
|
||||
<i class="fa-solid fa-cloud-arrow-up fa-3x text-muted mb-4"></i>
|
||||
<h3 class="h4 fw-bold mb-3">Drop files here</h3>
|
||||
<p class="text-muted mb-4">or click to browse</p>
|
||||
<p class="text-muted mb-4">or click <i class="fa-solid fa-arrow-down"></i></p>
|
||||
<input type="file" id="file-input" multiple class="d-none" accept="*" />
|
||||
<label for="file-input" class="btn btn-primary btn-lg px-5">
|
||||
<label for="file-input" class="btn btn-success btn-lg px-5">
|
||||
<i class="fa-solid fa-folder-open me-2"></i>Choose Files
|
||||
</label>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user