Skip to content

Barebones implementation for a simple http-server inspired by axum like API

Notifications You must be signed in to change notification settings

omagdy7/tiny-server

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

21 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

tiny-server

A barebones implementation for a simple http-server inspired by axum like API

TODO

  • Set up a socket to listen on a specific port.
  • Accept incoming connections in a loop.
  • Read the raw HTTP request from the client.
  • Parse the HTTP request to extract the method, path, and protocol.
  • Implement handling for GET requests.
  • Return a basic HTTP response with a status line, headers, and body.
  • Add support for query parameters by parsing the request URL.
  • Add support for serving static files (e.g., HTML, CSS, JS).
  • Implement handling for 404 Not Found responses.
  • Handle POST requests and read the request body.
  • Implement response headers for Content-Type and Content-Length.
  • Add support for custom error pages.
  • Implement routing to handle different paths dynamically.
  • Add a basic logging mechanism to log requests and responses.
  • Serve files with MIME type detection based on the file extension.
  • Add support for HTTP/1.1 keep-alive connections.
  • Implement support for CORS headers.
  • Add support for URL-encoded form submissions.
  • Add support for serving JSON responses.
  • Implement a mechanism to handle request timeouts.
  • Add basic support for HTTP status codes (e.g., 200, 404, 500).
  • Add a configuration file or environment variables for server settings (e.g., port, root directory).

References

About

Barebones implementation for a simple http-server inspired by axum like API

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages