← Back to braziljs/js-the-right-way

How to Deploy & Use braziljs/js-the-right-way

JS The Right Way - Deployment & Usage Guide

1. Prerequisites

  • Git (for cloning the repository)
  • Modern web browser (Chrome, Firefox, Safari, Edge)
  • Optional: Node.js (v14+) and npm — only if you prefer a local development server over direct file access

2. Installation

Clone the repository to your local machine:

git clone https://github.com/jstherightway/js-the-right-way.git
cd js-the-right-way

No dependency installation is required — this is a static HTML site.

3. Configuration

This project requires no environment variables, API keys, or build configuration.

For custom domain deployment only: If deploying to your own domain (instead of the default GitHub Pages/Netlify subdomain), create or edit the CNAME file in the project root:

echo "yourdomain.com" > CNAME

4. Build & Run

No build step is required. Choose one of the following methods to view the site locally:

Option A: Direct File Access (Simplest)

Open index.html directly in your browser:

# macOS
open index.html

# Linux
xdg-open index.html

# Windows
start index.html

Option B: Local Development Server (Recommended)

Use a local server to avoid CORS issues with external resources and ensure proper asset loading:

Using Python (if installed):

# Python 3
python -m http.server 8000

# Python 2
python -m SimpleHTTPServer 8000

Using Node.js:

npx serve -p 8000

Using PHP:

php -S localhost:8000

Then navigate to http://localhost:8000 in your browser.

5. Deployment

GitHub Pages (Recommended)

  1. Push the repository to GitHub
  2. Go to Settings > Pages in your repository
  3. Select source: Deploy from a branch
  4. Choose branch: main (or master) and folder: / (root)
  5. Save. Your site will be available at https://yourusername.github.io/js-the-right-way

For custom domain: Add your domain to the CNAME file and configure DNS records (CNAME or A records) pointing to GitHub Pages.

Netlify

  1. Drag and drop the project folder to Netlify Drop
  2. Or connect your GitHub repository for continuous deployment
  3. Build settings: Leave blank (no build command, publish directory: .)

Vercel

npx vercel --prod

When prompted:

  • Set up and deploy: Y
  • Link to existing project: N (or link if updating)
  • Build command: (leave empty, press Enter)
  • Output directory: . (current directory)

Any Static Host

Upload all files (HTML, CSS, JS, images) to your web server via FTP/SFTP, or sync with AWS S3, Cloudflare Pages, or Surge.sh.

6. Troubleshooting

IssueSolution
Assets (CSS/JS) not loadingYou're likely using file:// protocol. Use a local server (Option B in section 4) instead of opening the file directly.
Custom domain shows 404Ensure the CNAME file exists in the repository root with your domain name. Check DNS records are properly configured (CNAME pointing to username.github.io for GitHub Pages).
Changes not appearing after deploymentClear browser cache or perform a hard refresh: Ctrl+F5 (Windows/Linux) or Cmd+Shift+R (macOS).
Images not displayingVerify image paths are relative (e.g., ./images/logo.png not /images/logo.png) if deploying to a subdirectory.
License compliance warningThis project uses CC BY-NC-SA 3.0. Ensure your deployment does not imply commercial use without permission.