Skip to content

Commit

Permalink
chore: script for runserver (#106)
Browse files Browse the repository at this point in the history
  • Loading branch information
luismayta committed Apr 13, 2021
1 parent c88970e commit 67a1826
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions runserver.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# -*- coding: utf-8 -*-
from argparse import ArgumentParser
from multiprocessing import cpu_count

from app import app


HOSTS = ('127.0.0.1', '0.0.0.0')

parser = ArgumentParser(__doc__)
parser.add_argument('-p', '--port', type=int, default=8000)
parser.add_argument('-H', '--host', choices=HOSTS, default=HOSTS[0])
parser.add_argument('-w', '--workers', type=int, default=cpu_count())
args = parser.parse_args()

app.run(host=args.host, port=args.port, workers=args.workers)

0 comments on commit 67a1826

Please sign in to comment.