O'Reilly logo

TypeScript Blueprints by Ivo Gabe de Wolff

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Running the application

To test the application, the server and the static files have to be served from the same server. To do that, you can use the http-server package. That server can serve the static files and pass through (proxy) the requests to the API server. If MongoDB is not running yet, open a terminal window and run mongod --dbpath ./data. Open a terminal window in the root of the project and run the following to start the API server on localhost:8800:

gulp && node --harmony_destructuring dist/server

In a new terminal window, navigate to the static directory. Install http-server using the following command:

npm install http-server -g

Now you can start the server:

http-server -P http://localhost:8800

Open localhost:8080 in a browser and ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required