diff options
author | Harald Eilertsen <haraldei@anduin.net> | 2017-12-17 21:14:45 +0100 |
---|---|---|
committer | Harald Eilertsen <haraldei@anduin.net> | 2017-12-17 21:14:45 +0100 |
commit | 4e960f65ac0a9fb10aa89664b067ba501b90100d (patch) | |
tree | 8cfc49f2edfdb6de09b25a34e97e82c0eb5e8d49 | |
parent | 994084be2299f8f471b94187085eb8d4d61a1c1c (diff) | |
download | rocket-blog-4e960f65ac0a9fb10aa89664b067ba501b90100d.tar.gz rocket-blog-4e960f65ac0a9fb10aa89664b067ba501b90100d.tar.bz2 rocket-blog-4e960f65ac0a9fb10aa89664b067ba501b90100d.zip |
Update README
-rw-r--r-- | README.md | 35 |
1 files changed, 35 insertions, 0 deletions
@@ -2,4 +2,39 @@ This is essentially a toy project to learn [Rocket](https://rocket.rs) and [Diesel](https://diesel.rs). Also I'm using [Bart](https://crates.io/crates/bart) for templates, because it seemed simple, and I like the name. +## Getting started + +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 + +Then add a database url into a `.env`-file that is to be located in the root of the source directory: + + % echo DATABASE_URL=postgres://dbuser:password@localhost/dbname > .env + +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. + +Next install `diesel_cli`: + + % cargo install diesel_cli + +Then run the diesel setup to create the database and run the migrations: + + % ~/.cargo/bin/diesel setup + +Check that everything is working: + + % cargo test + +Run the engine: + + % cargo run + +## License + This project is provided as free software under the GNU AGPL v3, see LICENSE for details. |