Merge pull request #197 from vicb/0827-httpserver
Step by step guide: use http-server instead of python
This commit is contained in:
commit
2aa4751216
|
@ -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 <a href="../quickstart.html">quickstart</a> to get Typescript setup.
|
You can edit and test out your apps by serving local files with a web server. Follow the steps in the <a href="../quickstart.html">quickstart</a> to get Typescript setup.
|
||||||
|
|
||||||
p.
|
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 <code>npm install -g http-server</code>.
|
||||||
|
(If that results in an access error, then you might need to use
|
||||||
|
<code><b>sudo</b> npm ...</code>.)
|
||||||
|
|
||||||
pre.prettyprint.lang-bash
|
p For example:
|
||||||
code python -m SimpleHTTPServer 8000
|
|
||||||
|
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
|
.callout.is-helpful
|
||||||
header Typescript vs ES5
|
header Typescript vs ES5
|
||||||
|
|
|
@ -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 <a href="../quickstart.html">quickstart</a> to get Typescript setup.
|
You can edit and test out your apps by serving local files with a web server. Follow the steps in the <a href="../quickstart.html">quickstart</a> 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 <code>npm install -g http-server</code>. (If that results in an access error, then you might need to use <code><b>sudo</b> npm ...</code>.)
|
||||||
|
|
||||||
|
For example:
|
||||||
|
|
||||||
pre.prettyprint.lang-bash
|
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
|
.callout.is-helpful
|
||||||
header Typescript vs ES5
|
header Typescript vs ES5
|
||||||
|
|
|
@ -245,8 +245,9 @@
|
||||||
If you don't already have an HTTP server,
|
If you don't already have an HTTP server,
|
||||||
you can install one using <code>npm install -g http-server</code>.
|
you can install one using <code>npm install -g http-server</code>.
|
||||||
(If that results in an access error, then you might need to use
|
(If that results in an access error, then you might need to use
|
||||||
<code><b>sudo</b> npm ...</code>)
|
<code><b>sudo</b> npm ...</code>.)
|
||||||
For example:
|
|
||||||
|
p For example:
|
||||||
|
|
||||||
code-example.
|
code-example.
|
||||||
# From the directory that contains index.html:
|
# From the directory that contains index.html:
|
||||||
|
|
Loading…
Reference in New Issue