Skip to content

Instantly share code, notes, and snippets.

@TriathlonCodes
Last active January 29, 2016 22:02
Show Gist options
  • Save TriathlonCodes/a789068d094c016a47cb to your computer and use it in GitHub Desktop.
Save TriathlonCodes/a789068d094c016a47cb to your computer and use it in GitHub Desktop.
How to get to use a single line server call when you're running JavaScript files

How to get to use a single line server call when you're running JavaScript files

  1. if not already installed, install node.
  • to check if node is installed type "node" into your command line.
  • if you get the following message, node is not installed:
bash: node: command not found
  1. open your command line for your computer and type:
curl https://npmjs.org/install.sh | sh
npm install http-server -g
  1. that's it. Now navigate to your project run
    http-server
    on your command line, open up (localhost://8080)[localhost://8080] and your index.html will automatically be running on the server.

references: npm js

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