Crates.io | jake_the_dog |
lib.rs | jake_the_dog |
version | 1.0.1 |
source | src |
created_at | 2023-05-22 17:25:53.607912 |
updated_at | 2023-05-22 18:12:08.409015 |
description | jake_the_dog is a skeleton project that you can use to start a basic webserver using Rust and PostgreSQL |
homepage | |
repository | https://github.com/HarrisonHemstreet/jake_the_dog |
max_upload_size | |
id | 870885 |
size | 226,751 |
The purpose of this project is to give newcomers to Rust a basic project to learn from, and even use to start their own projects. Starting Rust can be hard. I'm probably a slower learner than most. It has taken me much longer than I would like to admit in order for me to learn everything in these five files. I know that other people are in this position as well. I hope that this repo can serve as a basic example of how these interlocking technologies work together. I know that I probably have not implemented everything according to best practices, but I did the best with what I had. If you would like me to change anything in here, feel free to open a pull request or ask a question.
cargo doc --open
. Running this command will cause Cargo to generate all the relevant documentation for this project. You can also google the documentation via going to docs.rs online and searching for the relevant crate you are interested in..env
file with the following values set: DBHOST
, DBUSER
, DBPORT
, DBPASSWORD
, DBNAME
. All these values will correlate to how you set up PostgreSQL.docker compose
installed (the current version as of writing this is the one lacking the hyphen, so not the docker-compose
version)docker compose up -d
localhost:8080/hello/harry
and localhost:8080/db_test
and receive a JSON response.http://localhost:16543
. The username is test@test.com
and the password is test
i. to add the PostgreSQL server in PgAdmin4, after logging in click on "Add New Server". On the 'General' tab, name the server anything you would like. Next, select the 'Connection' tab. In place of the 'Host name/address', run this command: ifconfig | grep inet
, and input one of the output ip addresses. For the 'port', input 5440
. For 'Maintenance database', input root
. For 'Username', input root
. For 'Password', input root
. Finally, if everything has been input correctly, you should be able to hit the save button on the modal and you should be connected.docker_postgres_init.sql
, you should see an INSERT
statement at the bottom of the file. If there isn't any data in the product
table, then feel free to run that query in PgAdmin. If the localhost:8080/db_test
endpoint was not working before, it may now.wiki: https://adventuretime.fandom.com/wiki/Jake
I chose Jake to be the mascot of this project, because Jake is the most dependable friend a person could have. Jake is also very flexible. Flexibility and dependability are two abilities I look for in a webserver.