This is my personal blog.
- Redis
- Postgresql
$ curl https://sh.rustup.rs -sSf | sh
This project use Diesel as Orm framework, so you need to install its command line tool via Rust package manager(eg, Cargo)
$ cargo install diesel_cli --no-default-features --features postgres
you need to install Postgresql database, and then configure postgresql by following document’s guide
$ yum install postgresql96-contrib
$ ./init.sh # press 3 to init database
$ diesel migration run # this will renew schema.rs without view created in create_tags/up.sql
Diesel.rs Trick: Treat View as Table
nginx has been used in the development of the time
server {
listen 8880;
server_name 127.0.0.1;
location / {
proxy_pass http://127.0.0.1:8080;
proxy_redirect off;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
}
location /api/v1/ {
proxy_pass http://127.0.0.1:8888/;
proxy_redirect off;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
}
Ref: Accessing host machine from within docker container Docker Desktop for Mac docker
$ cargo run --bin blog_web // listen on 127.0.0.1:8080
$ cargo run --bin blog_api // listen on 127.0.0.1:8888
if you want to login admin, the account is admin
, password is admin