Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
H
Hackathon_2_2022
Manage
Activity
Members
Labels
Plan
Issues
2
Issue boards
Milestones
Code
Merge requests
1
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Deploy
Package Registry
Model registry
Operate
Terraform modules
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Ferdinand Badu
Hackathon_2_2022
Commits
8c725557
Commit
8c725557
authored
2 years ago
by
Ferdinand Badu
Browse files
Options
Downloads
Patches
Plain Diff
backend for form in python
parent
aab26103
Branches
Form
No related tags found
1 merge request
!1
Form
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
backend.py
+24
-0
24 additions, 0 deletions
backend.py
with
24 additions
and
0 deletions
backend.py
0 → 100644
+
24
−
0
View file @
8c725557
from
http.server
import
BaseHTTPRequestHandler
,
HTTPServer
class
MyServer
(
BaseHTTPRequestHandler
):
def
do_GET
(
self
):
self
.
send_response
(
200
)
self
.
send_header
(
"
Content-type
"
,
"
text/html
"
)
self
.
end_headers
()
self
.
wfile
.
write
(
bytes
(
"
<html><head><title> Server for form </title></head>
"
,
"
utf-8
"
))
self
.
wfile
.
write
(
bytes
(
"
<body>
"
,
"
utf-8
"
))
self
.
wfile
.
write
(
bytes
(
"
<p>for for hackathon 2
"
,
"
utf-8
"
))
self
.
wfile
.
write
(
bytes
(
"
</body></html>
"
,
"
utf-8
"
))
if
__name__
==
"
__main__
"
:
webServer
=
HTTPServer
((
'
localhost
'
,
8080
),
MyServer
)
print
(
"
hackathon 2 local server started at port 8080
"
)
try
:
webServer
.
serve_forever
()
except
KeyboardInterrupt
:
pass
webServer
.
server_close
()
print
(
"
Server stopped.
"
)
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment