From 56d1c6391c2d6c0a86258cd0061d0516aa67f4b7 Mon Sep 17 00:00:00 2001 From: Victor Berchet Date: Thu, 27 Aug 2015 16:03:15 -0700 Subject: [PATCH] Step by step guide: use http-server instead of python --- public/docs/js/latest/guide/setup.jade | 14 +++++++++++--- public/docs/js/latest/guide/setupAlt.jade | 14 ++++++++++---- public/docs/js/latest/quickstart.jade | 5 +++-- 3 files changed, 24 insertions(+), 9 deletions(-) diff --git a/public/docs/js/latest/guide/setup.jade b/public/docs/js/latest/guide/setup.jade index 4a851bf8ff..65ad0c942f 100644 --- a/public/docs/js/latest/guide/setup.jade +++ b/public/docs/js/latest/guide/setup.jade @@ -12,10 +12,18 @@ You can edit and test out your apps by serving local files with a web server. Follow the steps in the quickstart to get Typescript setup. p. - When you're serving local files, edit and save them and start a web server that serves files in that directory. If you have Python installed, you can run a basic HTTP server from the root of your code directory with: + If you don't already have an HTTP server, + you can install one using npm install -g http-server. + (If that results in an access error, then you might need to use + sudo npm ....) - pre.prettyprint.lang-bash - code python -m SimpleHTTPServer 8000 + p For example: + + code-example. + # From the directory that contains index.html: + npm install -g http-server # Or sudo npm install -g http-server + http-server # Creates a server at localhost:8080 + # In a browser, visit localhost:8080/index.html .callout.is-helpful header Typescript vs ES5 diff --git a/public/docs/js/latest/guide/setupAlt.jade b/public/docs/js/latest/guide/setupAlt.jade index f23bdde63d..10f261bddc 100644 --- a/public/docs/js/latest/guide/setupAlt.jade +++ b/public/docs/js/latest/guide/setupAlt.jade @@ -12,10 +12,16 @@ include ../../../../_includes/_util-fns You can edit and test out your apps by serving local files with a web server. Follow the steps in the quickstart to get Typescript setup. - When you're serving local files, edit and save them and start a web server that serves files in that directory. If you have Python installed, you can run a basic HTTP server from the root of your code directory with: + If you don't already have an HTTP server, you can install one using npm install -g http-server. (If that results in an access error, then you might need to use sudo npm ....) + + For example: pre.prettyprint.lang-bash - code python -m SimpleHTTPServer 8000 + code. + # From the directory that contains index.html: + npm install -g http-server # Or sudo npm install -g http-server + http-server # Creates a server at localhost:8080 + # In a browser, visit localhost:8080/index.html .callout.is-helpful header Typescript vs ES5 @@ -33,11 +39,11 @@ include ../../../../_includes/_util-fns In the ``, add an element called `` that will be the root of your application. - + The TypeScript setup includes System.js, a third-party open-source library that adds ES6 module loading functionality to browsers. This step isn't needed for the ES5 version. +makeTabs('gettingstarted', 'ts/index.html,js/index.html', 'TypeScript, JavaScript') - + .callout.is-helpful header Don't use code.angularjs.org in a live app :markdown diff --git a/public/docs/js/latest/quickstart.jade b/public/docs/js/latest/quickstart.jade index 28ea7d9027..f5eec2aa35 100644 --- a/public/docs/js/latest/quickstart.jade +++ b/public/docs/js/latest/quickstart.jade @@ -245,8 +245,9 @@ If you don't already have an HTTP server, you can install one using npm install -g http-server. (If that results in an access error, then you might need to use - sudo npm ...) - For example: + sudo npm ....) + + p For example: code-example. # From the directory that contains index.html: