Creating a simple server locally

If you are using ajax calls in javascript, it won’t work locally as browsers restrict xmlhttp calls.

Work around for this is to install node js locally and create a simple http server in any particular folder.

Once node is being installed, open node command prompt.

Locate to the folder and

`npm install -g http-server`

This will create the server in your local folder

Then to start the server type

You can terminate it any time by ctrl+c


Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s