From 5dde1f55d818a74e838afa37b0e20217b1549a83 Mon Sep 17 00:00:00 2001 From: Melonai Date: Tue, 2 Feb 2021 18:55:38 +0100 Subject: Update README and add an example .env --- README.md | 33 ++++++++++++++++----------------- 1 file changed, 16 insertions(+), 17 deletions(-) (limited to 'README.md') diff --git a/README.md b/README.md index 732efcd..f4c5d96 100644 --- a/README.md +++ b/README.md @@ -3,37 +3,36 @@ A simple URL shortener built to be fast and easy. >Supports up to 262144 unique three-character links, guarantees absolutely zero collisions! -### Building +### Configuring -To deploy please first ensure you either have these variables in your enviroment or in your .env file. +To deploy please first create a `.env` file in the sho.rest root folder with your configuration. +You can use the `.env.example` file as a baseline. ``` -DATABASE_URL= -PORT= +POSTGRES_PASSWORD= +PORT= ``` -After you made sure these variables exist, run this to build the frontend. +To update create and manage Diesel migrations your .env also has to have a `DATABASE_URL` variable. +This is included in `.env.example` for simplicity -> sho.rest does not support npm at this point of time, but I doubt it's too hard to set up anyway. - -```sh -$ yarn postinstall +``` +DATABASE_URL=postgres://postgres:@localhost:5432/shorest ``` -After building the frontend, build the underlying server using: +Please note that the password you pick has to be the same in both variables. -```sh -$ cargo build --release -``` +### Deploying -### Running +sho.rest is fully built and deployed using `docker-compose`. +The URL database is created and stored inside a Docker volume. -Run the binary executable created by cargo in target using: +To start the necessary containers, simply run: ```sh -$ ./target/release/shorest +$ docker-compose up -d ``` -View the results at `http://localhost:` in your browser of choice! +You can view the results at `http://localhost:` in the browser of your choice! ---- -- cgit 1.4.1 '>range
blob: 84c792a7e33f716580728cba471baba454730af8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
# This file is automatically @generated by Cargo.
# It is not intended for manual editing.
version = 3

[[package]]
name = "anyhow"
version = "1.0.44"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "61604a8f862e1d5c3229fdd78f8b02c68dcf73a4c4b05fd636d12240aaa242c1"

[[package]]
name = "rabbithole"
version = "0.1.0"
dependencies = [
 "anyhow",
]