Skip to content

Instantly share code, notes, and snippets.

@maxfire2008
Last active August 9, 2022 22:45
Show Gist options
  • Save maxfire2008/8b822cb87a2f4ca54ab15cc46f56d076 to your computer and use it in GitHub Desktop.
Save maxfire2008/8b822cb87a2f4ca54ab15cc46f56d076 to your computer and use it in GitHub Desktop.
Makes flask much much much easier to use with a powershell script
#!/usr/bin/pwsh
param (
[string]$FlaskApp = "app.py",
[string]$FlaskEnvironment = "development",
[string]$IPHost = "127.0.0.1",
[string]$Port = 5000
)
#set env var "FLASK_APP" to $args[0]
#set env var "FLASK_ENV" to $args[1]
$env:FLASK_APP=$FlaskApp
$env:FLASK_ENV=$FlaskEnvironment
py -m flask run --host $IPHOST --port $Port
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment