Skip to content

ThomasHumper/simple-node-static-server

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

9 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

Simple Node.js Static Server πŸš€

A basic Node.js server to serve static files such as HTML, CSS, and JavaScript. This project demonstrates how to create a simple web server using Node.js's built-in http and fs modules, without any external dependencies.

Features ✨

  • Serve static HTML, CSS, and JavaScript files
  • Basic error handling for 404 and 500 errors
  • Support for common MIME types

Getting Started πŸš€

Prerequisites πŸ› οΈ

  • Node.js (v14 or higher recommended)

Installation πŸ”§

  1. Clone the repository:

    git clone https://github.com/your-username/simple-node-static-server.git
  2. Navigate to the project directory:

    cd simple-node-static-server
  3. Install dependencies (if any):

    This project uses only built-in Node.js modules, so no additional dependencies need to be installed.

Usage πŸƒβ€β™‚οΈ

  1. Start the server:

    node index.js
    
  2. Open your browser and go to:

    http://localhost:3000
    

    You should see a simple static page served by the Node.js server.

Project Structure πŸ—‚οΈ

/public
  - index.html         # Main HTML file
  - style.css          # CSS styles
  - script.js          # JavaScript file
/index.js              # Node.js server script
package.json           # Project metadata

License πŸ“œ

This project is licensed under the MIT License - see the LICENSE file for details.

Acknowledgements πŸ™

  • This project is intended for educational purposes and demonstrates basic static file serving with Node.js.

About

πŸš€ A basic Node.js server for serving static files such as HTML, CSS, and JavaScript. Perfect for learning how to create a simple web server without external dependencies.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors