✨ It's not really a secret, the website is mostly written with GPT ✨
Run this command to install the Github repo, it's needed for the rest of the instructions.
git clone 'https://github.com/localscripts/localscripts.github.io.git' && cd localscripts.github.io'
There are two free static hosting providers that are the best:
- Netlify (suggested)
- Github Pages
The instructions for both options are well documented and would add too much bloat if added here. Instructions for Netlify, and instructions for Github Pages.
- Install Visual Studio Code
- Download and install from Visual Studio Code.
If you want to see the website but not host it, follow the quick and dirty instructions. If you want to host the server in a public context, follow the slow and robust instructions (not recommended when hosted on a personal device).
-
Install the extension
Live Preview
(The publisher should bemicrosoft.com
). If you can't find it using the extension explorer in VSCode, you can manually install it by going to this site. -
Open the github repo in VSCode, right click
index.html
and selectShow Preview
. This will open a tab in VSCode. If you want to see the website in your browser, the just copy the URL in the VSCode tab and enter it in your preferred browser.
-
Install Python (if not already installed)
- Download and install from Python.
-
Install NPM (using WinGet)
- Run this Powershell line to install
npm
winget install -e --id OpenJS.NodeJS
- Run this Powershell line to install
-
Open the Folder in Visual Studio Code
- Launch Visual Studio Code and open the extracted folder.
-
Open a Terminal in Visual Studio Code
- Press
Ctrl+Shift+~
to open a new terminal window in Visual Studio Code.
- Press
-
Install
http-server
Globally- Run the following command to install
http-server
:npm install -g http-server
- Run the following command to install
-
Start a Python HTTP Server
- Run the following command to start a Python HTTP server:
python -m http.server
- Run the following command to start a Python HTTP server:
-
Find Your Local IP Address
- Press
Windows+R
, typecmd
, and hitEnter
to open Command Prompt. - Run the command
ipconfig
and locate your IPv4 Address.
- Press
-
Access Your Project in a Browser
- Open your browser and navigate to
<IP>:<Port>
. For example, if your IP address is192.168.1.10
and the port is8000
, enterhttp://192.168.1.10:8000
. If you don't know your current local IP address, you can get it using this Powershell line:Get-NetIPAddress | Where-Object {$_.AddressFamily -eq 'IPv4' -and $_.InterfaceAlias -ne 'Loopback Pseudo-Interface 1'} | Select-Object IPAddress
This will give several IP addresses, pick the first one that starts with
192
. The others are either APIPA addresses, loopback addresses, or explicitly set on your machine. - Open your browser and navigate to
Warning
Using this method will run the server on your computer and should only be used for debugging. This means anyone who navigates to it is connecting directly to the hosting device. This can be a significant security issue if you don't know what you're doing, so limit access to this website to your local network when hosting on a personal computer. If you want to host a public website, refer to the public server instructions.