aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHarald Eilertsen <haraldei@anduin.net>2018-01-11 19:38:28 +0100
committerHarald Eilertsen <haraldei@anduin.net>2018-01-11 19:38:28 +0100
commit757770635c4c2537b03f9b1fb1576a8bf4609a72 (patch)
tree008b2c824e9571651f8b12e326debafabac8cf3a
parent87184cc0fc72756a111b83d44a87c27594921467 (diff)
downloadrocket-blog-757770635c4c2537b03f9b1fb1576a8bf4609a72.tar.gz
rocket-blog-757770635c4c2537b03f9b1fb1576a8bf4609a72.tar.bz2
rocket-blog-757770635c4c2537b03f9b1fb1576a8bf4609a72.zip
Update readme with Vagrant setup
-rw-r--r--README.md30
1 files changed, 28 insertions, 2 deletions
diff --git a/README.md b/README.md
index 27a4714..a9d1bb0 100644
--- a/README.md
+++ b/README.md
@@ -4,9 +4,33 @@ This is essentially a toy project to learn [Rocket](https://rocket.rs) and [Dies
## Getting started
+### Using Vagrant
+
+You need to inatsll both [Vagrant] and [VirtualBox] unless you already have them installed. Then from the directory where you have cloned the rocket-blog type:
+
+ % vagrant up
+
+This will install, prepare and start the virtual machine where you will run the program. This will take some time the first time you do it. Once it is done, you can log in to the virtual machine by typing:
+
+ % vagrant ssh
+
+In the virtual machine, do the following:
+
+ % cd /vagrant
+ % echo "DATABASE_URL=postgres://vagrant@localhost/rocket_blog" > .env
+ % diesel setup
+
+The application is now ready, and can be started like this:
+
+ % cargo run
+
+Now you can open http://localhost:8000 in your web browser.
+
+### Using a local developer setup
+
First make sure you have PostgreSQL installed. We don't support any other database engine for now. You also need the nightly Rust compiler for now. To set the current project to use the nightly compiler, run:
- % rustup override nightly
+ % rustup override nightly-2017-12-21
Then add a database url into a `.env`-file that is to be located in the root of the source directory:
@@ -15,7 +39,6 @@ Then add a database url into a `.env`-file that is to be located in the root of
Then create the user and database specified above:
% createuser -U postgres --createdb --login -P dbuser
- % createdb -U dbuser dbname -T template0
Replace `dbuser`, `dbname` and `password` with values that makes sense to you. You will be prompted for the password when creating the user.
@@ -38,3 +61,6 @@ Run the engine:
## License
This project is provided as free software under the GNU AGPL v3, see LICENSE for details.
+
+[Vagrant]: https://www.vagrantup.com
+[VirtualBox]: https://www.virtualbox.org/