reduced slack functionality, higher ease of use. Database migration wip
This commit is contained in:
@@ -1,10 +0,0 @@
|
||||
# Svelte.js + Flask
|
||||
|
||||
A super simple example of using Flask to serve a Svelte app and use it as a backend server.
|
||||
|
||||
Run the following for development:
|
||||
|
||||
- `python server.py` to start the Flask server.
|
||||
- `cd client; npm install; npm run autobuild` to automatically build and reload the Svelte frontend when it's changed.
|
||||
|
||||
This example just queries the Flask server for a random number.
|
@@ -1,4 +1,3 @@
|
||||
from crypt import methods
|
||||
import json
|
||||
from flask import Flask, send_from_directory, jsonify
|
||||
import random
|
||||
@@ -7,7 +6,8 @@ app = Flask(__name__)
|
||||
|
||||
|
||||
###############################################################################
|
||||
# SVELTE BACKEND. Always send index.html and the requested js-files. (compiled by npm)
|
||||
# SVELTE 'STATIC' BACKEND. Always send index.html and the requested js-files. (compiled by npm)
|
||||
|
||||
@app.route("/") #index.html
|
||||
def base():
|
||||
return send_from_directory('../client/public', 'index.html')
|
||||
@@ -17,6 +17,7 @@ def home(path):
|
||||
|
||||
|
||||
|
||||
|
||||
###############################################################################
|
||||
# API for news_check.
|
||||
|
||||
@@ -34,4 +35,4 @@ def set_article(id):
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
app.run(debug=True)
|
||||
app.run(host="0.0.0.0", port="80")
|
3
news_check/server/package-lock.json
generated
3
news_check/server/package-lock.json
generated
@@ -1,3 +0,0 @@
|
||||
{
|
||||
"lockfileVersion": 1
|
||||
}
|
Reference in New Issue
Block a user