Blog Post
Serving Static Files with HTTP-Server π
http-server is an easy-to-use, zero-configuration command-line HTTP server for serving static files during project development.
π» To get started:
Run this command in your terminal:
- Install http-server globally:
Code
npm install -g http-serverDisable caching to see file changes immediately by running:
- Run the server without caching:
Code
http-server -c-1- Open your browser and navigate to:
Code
localhost:8080Press Ctrl + C in your terminal to stop the server.
- To quit the server, use:
π Note: Disabling caching is great for development because it ensures that any changes you make to your static files are immediately reflected in the browser, without the interference of cached versions.