9/11/2017 - 9:15 PM

Ejecutar una aplicacion web

(nodejs, http-server)

Ok, now that we have a view, we're ready to run our app. To do that, we'll need to start a web server to serve up your index.html page, so we can view it in a browser. How you go about doing that depends on which server-side technology you want to use. Below are instructions for a couple of common scenarios:

  • Visual Studio - Open Visual Studio 2015. Using the main menu, select File > Open > Web site... In the resulting dialog, choose the project folder then click the Open button. The folder contents will be displayed in the Visual Studio Solution Explorer window. Right click on index.html in Solution Explorer and select "View in Browser".
    This will fire up IISExpress and serve index.html
  • NodeJS - To start up a simple web server in the project folder,
    first globally install the http-server command with npm install http-server -g (In some environments you may need to use sudo).
    Once that is installed, change directory to the project folder.
    You can now spin up the server from within the folder with the following command
    http-server -o -c-1
  • Firefox - If you don't want to worry about setting up a web server, Firefox is flexible enough to serve the app
    directly from your hard drive.
    Simply open the index.html file with Firefox.


-o Open browser window after starting the server
-p Port to use (defaults to 8080)
-c Set cache time (in seconds) for cache-control max-age header,
e.g. -c10 for 10 seconds (defaults to '3600'). To disable caching, use -c-1
-s or --silent Suppress log messages from output
-S or --ssl Enable https.