{"id":34953185,"url":"https://github.com/theekshana-nirmal/simple-node-server","last_synced_at":"2026-05-21T08:37:19.510Z","repository":{"id":288369517,"uuid":"967262543","full_name":"theekshana-nirmal/simple-node-server","owner":"theekshana-nirmal","description":"This project is a basic HTTP server created using Node.js's built-in http module. It is designed as a learning exercise to understand the fundamentals of server-side programming before moving on to frameworks like Express.js. The goal is to build a strong foundation in Node.js by starting with the basics.","archived":false,"fork":false,"pushed_at":"2025-04-17T09:48:29.000Z","size":421,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-04-17T18:04:24.829Z","etag":null,"topics":["backend-development","http-module","http-server","javascript","learning-project-nodejs","node","nodejs","nodemon","simple-server","web-server"],"latest_commit_sha":null,"homepage":"","language":"HTML","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/theekshana-nirmal.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2025-04-16T07:21:55.000Z","updated_at":"2025-04-17T09:48:32.000Z","dependencies_parsed_at":"2025-04-17T18:04:28.343Z","dependency_job_id":"8d77e9f5-fe98-4fba-9b06-ecefad4f322f","html_url":"https://github.com/theekshana-nirmal/simple-node-server","commit_stats":null,"previous_names":["theekshana-nirmal/simple-node-server"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/theekshana-nirmal/simple-node-server","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/theekshana-nirmal%2Fsimple-node-server","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/theekshana-nirmal%2Fsimple-node-server/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/theekshana-nirmal%2Fsimple-node-server/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/theekshana-nirmal%2Fsimple-node-server/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/theekshana-nirmal","download_url":"https://codeload.github.com/theekshana-nirmal/simple-node-server/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/theekshana-nirmal%2Fsimple-node-server/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":33294031,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-21T02:57:32.698Z","status":"ssl_error","status_checked_at":"2026-05-21T02:57:31.990Z","response_time":62,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["backend-development","http-module","http-server","javascript","learning-project-nodejs","node","nodejs","nodemon","simple-server","web-server"],"created_at":"2025-12-26T21:44:42.777Z","updated_at":"2026-05-21T08:37:19.505Z","avatar_url":"https://github.com/theekshana-nirmal.png","language":"HTML","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Simple Node Server with Routing\n\n[![Node.js](https://img.shields.io/badge/Node.js-22.x+-green.svg)](https://nodejs.org/)\n[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)\n\nA simple HTTP server built using Node.js's built-in `http` module. This project demonstrates basic routing and serves static HTML files. It is designed as a learning exercise to understand the fundamentals of server-side programming and routing before transitioning to more advanced frameworks like Express.js.\n\n![Response from the /about Path](./public/screenshot.png)\n\n\u003e *This screenshot illustrates the output when making a GET request to the `/about` path of the Node.js HTTP server using the Postman extension within VS Code. The server correctly responds with a basic HTML page, demonstrating the routing functionality for the `/about` endpoint.*\n\n## ✨ Features\n\n- Basic HTTP server implementation.\n- Serves static HTML files for different routes (`/` and `/about`).\n- Handles errors for unsupported routes and methods.\n- Uses Node.js's built-in `http` module and `fs/promises` for file handling.\n- Configures the server port using environment variables (`.env` file).\n- Lightweight and beginner-friendly.\n\n## 🎯 Purpose\n\nThis project was created to:\n\n- Understand how to create a basic server using Node.js's `http` module.\n- Learn how to implement basic routing for different URL paths.\n- Explore serving static HTML files instead of plain text responses.\n- Practice using environment variables for configuration (e.g., port numbers).\n- Build a foundation for developing more complex web applications and APIs.\n\n## 🚀 How to Run\n\n1. **Clone this repository:**\n\n   ```bash\n   git clone https://github.com/theekshana-nirmal/simple-node-server.git\n   ```\n\n   ```bash\n   cd simple-node-server\n   ```\n2. **Install dependencies:**\n\n   ```bash\n   npm install\n   ```\n3. **Create a `.env` file:**\n   Create a file named `.env` in the root directory of the project and add the following line:\n\n   ```env\n   PORT=3000\n   ```\n\n   *(You can change `3000` to any port you prefer)*\n4. **Create the `public` directory:**\n   Inside the project root, create a folder named `public` and add the following files:\n\n   - `index.html`: The homepage content.\n   - `about.html`: The content for the `/about` route.\n5. **Start the server:**\n\n   ```bash\n   npm run dev\n   ```\n6. **Access the server:**\n   Open your web browser and navigate to:\n\n   - `http://localhost:PORT/` for the homepage.\n   - `http://localhost:PORT/about` for the about page.\n\n   *(Replace `PORT` with the value you set in your `.env` file, e.g., `http://localhost:3000/`)*\n\n## 📚 Learning Objectives\n\n- Understand how to create a basic server using Node.js's `http` module.\n- Learn how to implement routing to handle different URL paths.\n- Explore serving static HTML files using `fs/promises`.\n- Grasp the concept of ports and listening for incoming connections.\n- Learn how to manage configuration like port numbers using environment variables (`.env` files).\n- Build a foundational understanding for developing more complex web applications and APIs.\n\n## 🌱 Future Plans\n\n- Add support for more routes and dynamic content.\n- Implement error pages for 404 and 500 errors.\n- Handle different HTTP methods (e.g., POST, PUT, DELETE).\n- Transition to using the Express.js framework for more robust features and easier development.\n- Add middleware for logging and request parsing.\n- Explore serving static assets like CSS and JavaScript files.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftheekshana-nirmal%2Fsimple-node-server","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftheekshana-nirmal%2Fsimple-node-server","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftheekshana-nirmal%2Fsimple-node-server/lists"}