Skip to content
Create a gist now

Instantly share code, notes, and snippets.

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

2) open your command line for your computer and type:

curl https://npmjs.org/install.sh | sh
npm install http-server -g
3) 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
Something went wrong with that request. Please try again.