Skip to content

Instantly share code, notes, and snippets.

@davehague
Last active September 19, 2024 14:05
Show Gist options
  • Save davehague/df1db466071b69d74d2a48a30aa66246 to your computer and use it in GitHub Desktop.
Save davehague/df1db466071b69d74d2a48a30aa66246 to your computer and use it in GitHub Desktop.
Local Development - Live Reload for HTML/JS/CSS

Using NPM live server to watch HTML files. To avoid CORS issues and to work more quickly when developing a static HTML site locally, use a local server like live-server for development.

  1. Install live-server
npm install -g live-server
  1. Serve the project. Navigate to the root directory of your project and start live-server:
live-server

This will start a local server and open your project in the browser. The local server will handle the requests properly, avoiding any CORS issues.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment