An example notes application built with RESTHeart, AngularJS and MongoDB.
Clone this repository locally
$ git clone firstname.lastname@example.org:SoftInstigate/restheart-notes-example.git $ cd restheart-notes-example
Install mongodb and RESTHeart
For detailed installation instructions refer to the documentation.
However the quickest way is using the docker-compose.yml in restheat's distribution:
Clone the restheart repo and cd into the Docker folder, then:
$ docker-compose up -d
After the docker mongodb and restheart containers are started in background, you can check the logs:
$ docker-compose logs -f
Create the data model
We will be using the RESTHeart API with httpie (you can also use another http client such as curl)
$ http -a admin:changeit PUT http://localhost:8080/rhnedb descr="restheart notes example db" HTTP/1.1 201 Created ... $ http -a admin:changeit PUT http://localhost:8080/rhnedb/notes descr="notes collection" HTTP/1.1 201 Created ...
Start the Web app
First of all you need Node.js for your system https://nodejs.org.
npm install -g bower grunt-cli
npm install to install project dependencies:
Optionally, install compass (you must have ruby properly installed in your system):
gem update --system gem install compass
bower install. If Bower asks you for the AngularJS version, choose the most recent.
If you want to preview the web application, run
grunt serve; after few seconds it should open the default browser at http://localhost:9000/.
If you don't have compass installed then you'll get an error message, in this case just use
grunt serve --force to continue.
To login in the Web app, you can use the admin user with password changeit
For more information on RESTHeart' security refer to the documentation.
grunt test will run the unit tests with karma.