angular-rest-browser — column browser for REST APIs
To get you started you can simply clone the angular-rest-browser repository and install the dependencies:
We have two kinds of dependencies in this project: tools and angular framework code. The tools help us manage and test the application.
- We get the tools we depend upon via
npm, the [node package manager][npm].
- We get the angular code via
bower, a [client-side code package manager][bower].
We have preconfigured
npm to automatically run
bower so we can simply do:
Behind the scenes this will also call
bower install. You should find that you have two new
folders in your project.
node_modules- contains the npm packages for the tools we need
bower_components- contains the angular framework files
Run the Application
We have preconfigured the project with a simple development web server. The simplest way to start this server is:
Now browse to the app at
Serving the Application Files
While angular is client-side-only technology and it's possible to create angular webapps that
don't require a backend server at all, we recommend serving the project files using a local
webserver during development to avoid issues with security restrictions (sandbox) in browsers. The
sandbox implementation varies between browsers, but quite often prevents things like cookies, xhr,
etc to function properly when an html page is opened via
file:// scheme instead of
Running the App during Development
The angular-rest-browser project comes preconfigured with a local development webserver. It is a node.js
tool called [http-server][http-server]. You can start this webserver with
npm start but you may choose to
install the tool globally:
Then you can start your own development web server to server static files, from a folder, by running:
Alternatively, you can choose to configure your own webserver, such as apache or nginx. Just
configure your server to serve the files under the
Running the App in Production
This really depends on how complex is your app and the overall infrastructure of your system, but
the general rule is that all you need in production are all the files under the
Everything else should be omitted.
Angular apps are really just a bunch of static html, css and js files that just need to be hosted somewhere, where they can be accessed by browsers.
If your Angular app is talking to the backend server via xhr or other means, you need to figure out what is the best way to host the static files to comply with the same origin policy if applicable. Usually this is done by hosting the files by the backend server or through reverse-proxying the backend server(s) and webserver(s).
[Travis CI][travis] is a continuous integration service, which can monitor GitHub for new commits
to your repository and execute scripts such as building the app or running tests. The angular-rest-browser
project contains a Travis configuration file,
.travis.yml, which will cause Travis to run your
tests when you push to GitHub.
You will need to enable the integration between Travis and GitHub. See the Travis website for more instruction on how to do this.