Coming soon
This is Ghost Systems, a brand new site that's just getting started. Things will be up and running here shortly, but you can subscribe in the meantime if you'd like to stay up to date and receive emails when new content is published!
import http.server
import socketserver
PORT = 8000
class MyRequestHandler(http.server.SimpleHTTPRequestHandler):
def do_GET(self):
self.send_response(200)
self.send_header("Content-type", "text/plain")
self.end_headers()
self.wfile.write(b"Hello, World!")
with socketserver.TCPServer(("", PORT), MyRequestHandler) as httpd:
print(f"Serving at port {PORT}")
httpd.serve_forever()package main
import (
"fmt"
"net/http"
)
func main() {
// Register a handler function for the default route ("/")
http.HandleFunc("/", func(w http.ResponseWriter, r *http.Request) {
fmt.Fprintf(w, "Welcome to the homepage!")
})
// Register a handler function for the "/hello" route
http.HandleFunc("/hello", helloHandler)
// Start the server on port 8080
fmt.Println("Server starting on port 8080...")
if err := http.ListenAndServe(":8080", nil); err != nil {
fmt.Println("HTTP server failed:", err)
}
}
// A separate handler function
func helloHandler(w http.ResponseWriter, r *http.Request) {
fmt.Fprintf(w, "Hello, world!\n")
}
| Header 1 | Header 2 | Header 3 |
|---|---|---|
| Row 1, Cell 1 | Row 1, Cell 2 | Row 1, Cell 3 (Red) |
| Row 2, Cell 1 | Row 2, Cell 2 | Row 2, Cell 3 |
| Row 3, Cell 1 | Row 3, Cell 2 (Skyblue) | Row 3, Cell 3 |