Skip to content

Instantly share code, notes, and snippets.

@modle
Last active November 30, 2022 18:12
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save modle/a9a468b9368deddeda2100929ac3d493 to your computer and use it in GitHub Desktop.
Save modle/a9a468b9368deddeda2100929ac3d493 to your computer and use it in GitHub Desktop.

install python dependencies

flask
flask-cors

app/__init__.py basic flask thing

from flask_cors import CORS
from flask import Flask

app = Flask(__name__)
CORS(app)

from app import views

service.py wrapper file

from app import app

app.run()

use this nssm tool

nssm install "_pytest" "C:\path\to\python.exe" "C:\path\to\service.py"
nssm start "_pytest"

do app.run(port=myport) in service.py for custom port

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment