Skip to content

Commit 3ad7697

Browse files
authored
Merge pull request #44 from fractal-analytics-platform/25-allow-two-simultaneous-executions-of-fractal-server
select port when launching fractal-server
2 parents 093573a + 8de624a commit 3ad7697

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

fractal_server/__main__.py

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,14 @@
1+
from sys import argv
2+
13
import uvicorn
24

35

4-
def run():
5-
uvicorn.run("fractal_server.main:app", reload=True)
6+
def run(port=8000):
7+
try:
8+
port = int(argv[1])
9+
except IndexError:
10+
pass
11+
uvicorn.run("fractal_server.main:app", port=port, reload=True)
612

713

814
if __name__ == "__main__":

0 commit comments

Comments
 (0)