File tree Expand file tree Collapse file tree 2 files changed +5
-23
lines changed
Expand file tree Collapse file tree 2 files changed +5
-23
lines changed Original file line number Diff line number Diff line change 1+ # Application Settings
2+ APP_NAME = template-python
3+ DEBUG = true
4+ ENV = development
Original file line number Diff line number Diff line change 1- import http .server
2- import socketserver
3- import os
4- from dotenv import load_dotenv
5-
6- # Load environment variables from .env file
7- load_dotenv ()
8-
9- # Get PORT from environment variable or use default 8000
10- PORT = int (os .getenv ("PORT" , 8000 ))
11-
12-
13- class MyHandler (http .server .BaseHTTPRequestHandler ):
14- def do_GET (self ):
15- self .send_response (200 )
16- self .send_header ("Content-type" , "text/plain" )
17- self .end_headers ()
18- self .wfile .write (b"Hello, World!" )
19-
20-
21- with socketserver .TCPServer (("" , PORT ), MyHandler ) as httpd :
22- print (f"Serving at port { PORT } " )
23- httpd .serve_forever ()
1+ print ("Hello, World!" )
You can’t perform that action at this time.
0 commit comments