{"id":2893,"date":"2021-11-15T09:09:18","date_gmt":"2021-11-15T01:09:18","guid":{"rendered":"http:\/\/euhat.com\/wp\/?p=2893"},"modified":"2021-11-15T18:26:12","modified_gmt":"2021-11-15T10:26:12","slug":"start-tiny-web-server-with-current-folder-as-http-root-path","status":"publish","type":"post","link":"http:\/\/euhat.com\/wp\/2021\/11\/15\/start-tiny-web-server-with-current-folder-as-http-root-path\/","title":{"rendered":"start tiny web server with current folder as http root path"},"content":{"rendered":"<p>httpd.py<\/p>\n<pre lang=\"python\" line=\"1\">\r\nfrom http.server import HTTPServer, SimpleHTTPRequestHandler\r\n\r\nhandler = SimpleHTTPRequestHandler\r\nhandler.extensions_map.update({\r\n\t\".js\": \"application\/javascript\",\r\n})\r\n\r\nserver_address = (\"\", 8008)\r\nserver = HTTPServer(server_address, handler)\r\nserver.serve_forever()\r\n<\/pre>\n<p>how to run<\/p>\n<pre lang=\"bash\" line=\"1\">\r\npython3 .\/httpd.py\r\n<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>httpd.py from http.server import HTTPServer, SimpleHTTPRequestHandler handler = SimpleHTTPRequestHandler handler.extensions_map.update({ \".js\": \"application\/javascript\", }) server_address = (\"\", 8008) server = HTTPServer(server_address, handler) server.serve_forever() how to run python3 .\/httpd.py<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[3],"tags":[677,678,221],"_links":{"self":[{"href":"http:\/\/euhat.com\/wp\/wp-json\/wp\/v2\/posts\/2893"}],"collection":[{"href":"http:\/\/euhat.com\/wp\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/euhat.com\/wp\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/euhat.com\/wp\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/euhat.com\/wp\/wp-json\/wp\/v2\/comments?post=2893"}],"version-history":[{"count":0,"href":"http:\/\/euhat.com\/wp\/wp-json\/wp\/v2\/posts\/2893\/revisions"}],"wp:attachment":[{"href":"http:\/\/euhat.com\/wp\/wp-json\/wp\/v2\/media?parent=2893"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/euhat.com\/wp\/wp-json\/wp\/v2\/categories?post=2893"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/euhat.com\/wp\/wp-json\/wp\/v2\/tags?post=2893"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}