• Download NodeJS: https://nodejs.org/en/download/
  • Installation guide for http-server is here: https://www.npmjs.com/package/http-server
    • The command to install is (both windows and mac/linux):

      npm install http-server -g
    • For testing purpose, download this package: barebonehtml.zip
    • When you unzip it, there should be a "public" folder
    • Go to the parent folder of that "public" (meaning you can see the "public" when typing dir/ls)
    • The command to start the server (both windows and mac/linux):

      http-server
    • Then type "http://localhost:8080/" in your browser
  • Additional cheat sheet: some commonly used commands in cmd(windows)/bash(osx,linux)
    • Windows
      • dir : list contents of the current directory
      • cd : goes into a specific directory
        • cd <dir> to go into a specific <dir>
        • cd .. to go upper one level
      • md/rd: make or remove a directory
      • del <file>: delete a <file>
    • Osx/linux
      • pwd : show what directory we are currently in
      • ls : list contents of the current directory
      • cd : goes into a specific directory
        • cd <dir> to go into a specific <dir>
        • cd .. to go upper one level
      • mkdir/rmdir: make or remove a directory
      • rm <file>: delete a <file>
      • sudo <command>: use super user to execute a command
        • This fix some problem installing or executing something, however use with caution as running malicious program with this will compromise your system
        • It will prompt for you to enter password the first time you use it, and when you type, there's no feedback on screen, this is normal, just enter the whole password and press enter.
  • No labels