/WildSnacks

Primary LanguageJavaScript

WildHacks

How to test sites

First open terminal/command prompt and get to directory of website

Python

  • Make sure you have python by running python --version
  • Run python -m SimpleHTTPServer
  • Just add the path of each folder to view it
  • To change to a different port, for instance, port 9001
    • run python -m SimpleHTTPServer 9001

NodeJS

  • Make sure you have node by running node -v
  • Run sudo npm install -g http-server
    • the -g means global so you only need to run this once on the server
  • Get to directory of website
  • Run http-server
  • Just add the path of each folder to view it
  • To change to a different port, for instance, port 9001
    • run http-server -p 9001

Adding a new site

Make all folders the name of the domain with a _ underscore in replace of the . dot

Also here is a quick HTML template

<!DOCTYPE html>
<html>
<head>
	<title>GitGood.org</title>
</head>
<body>
	TEST
</body>
</html>

Setting up NGINX to redirect all the domains

server {
        listen 80 default_server;
        listen [::]:80 default_server;

        root /var/www/html;

        index index.html index.htm;

        server_name ~^(www\.)?(?<domain>.+)$;

        location / {
                proxy_pass http://127.0.0.1:1337/$domain;
                try_files $uri $uri/ =404;
        }

}