Skip to content
This repository has been archived by the owner on Dec 22, 2023. It is now read-only.

SoftInstigate/restheart-blog-example

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

38 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Setup

Requirements

RESTHeart version required: 5+ at least.

Clone this project locally

$ git clone git@github.com:SoftInstigate/restheart-blog-example.git

Install Dependencies

$ cd restheart-blog-example
$ bower install

Download the latest restheart binary distribution archive, either the tar.gz or the .zip file.

Uncompress the downloaded archive, enter the folder and copy the restheart.jar file and plugins directory in the blog's main directory restheart-blog-example

Run the Application

Start MongoDB and RESTHeart (refer to RESTHEART documentation for more help)

$ mongod --fork --syslog
$ java -server -jar restheart.jar restheart.yml -e etc/local.properties

The application is available at http://127.0.0.1:8080/blog

Init the db

The very first time you'll be asked to initialize the database. This is achieved executing the following curl commands from command line:

$ curl -u admin:changeit -i -X PUT http://127.0.0.1:8080/data/blog -H "Content-Type: application/json"
$ curl -u admin:changeit -i -X PUT http://127.0.0.1:8080/data/blog/posts -H "Content-Type: application/json"

Run with docker

This is the simplest option. There's a docker-compose.yml which starts both RESTHeart and MongoDB as Docker containers.

$ docker-compose up

The docker folder contains specific configurations for docker.

You still have to initialize the database. If docker run directly on Localhost (Linux box) then the above curl commands works, otherwise if you are running with docker-machine you'l probably have to change the IP to 192.168.99.100

$ curl -u admin:changeit -i -X PUT http://192.168.99.100:8080/data/blog -H "Content-Type: application/json"
$ curl -u admin:changeit -i -X PUT http://192.168.99.100:8080/data/blog/posts -H "Content-Type: application/json"

Made with ❤️ by The SoftInstigate Team. Follow us on Twitter.

About

Example blog application built with RESTHeart and AngularJS

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published