saschagrunert / webapp.rs

A web application completely written in Rust. 🌍

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Empty webpage upon start

jaques-sam opened this issue · comments

commented

First, I read your Medium articles and they are amazing! Thanks for sharing this!

I have issues with showing something in the browser after running your application.
Just something that is weird about the readme:

Ensure the runtime dependencies are installed, and then **start the two containers**.
> sudo apt install -y postgresql-client
> cargo install diesel_cli --no-default-features --features "postgres"
> sudo make deploy

The last command doesn't start the containers, only builds them. (the makefile confirms this)

After executing make run-app, only the backend is running.
This allowed me to surf to http://127.0.0.1:30080/ but of course got panics because the frontend is not found.
So after make run-frontend, I just get an empty screen...

Can you help me getting this work?

Ah, forgot to mention. I'm using WSL2 with Debian ;-) Maybe this is related. Anyway, I've running both backend & frontend so I could see the traces, but no error is shown.

commented

Backend logs:

❯ make run-backend
Database already running
   Compiling webapp v1.0.0 (/home/samja/repos/other/webapp.rs)
   Compiling webapp-backend v1.0.0 (/home/samja/repos/other/webapp.rs/backend)
    Finished release [optimized] target(s) in 25.35s
     Running `target/release/backend`
[2021-09-20T12:16:04Z INFO  backend] Starting server from config path Config.toml for url http://127.0.0.1:30088
[2021-09-20T12:16:04Z INFO  webapp_backend::server] Starting server to redirect from http://127.0.0.1:30081/ to http://127.0.0.1:30088/
[2021-09-20T12:16:04Z INFO  webapp_backend::server] Starting server to redirect from https://127.0.0.1:30082/ to http://127.0.0.1:30088/
[2021-09-20T12:18:33Z INFO  actix_web::middleware::logger] 127.0.0.1:46716 "GET / HTTP/1.1" 200 567 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:92.0) Gecko/20100101 Firefox/92.0" 0.002286
[2021-09-20T12:18:34Z INFO  actix_web::middleware::logger] 127.0.0.1:46716 "GET /css/style.css HTTP/1.1" 200 255621 "http://127.0.0.1:30088/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:92.0) Gecko/20100101 Firefox/92.0" 0.001146
[2021-09-20T12:18:34Z INFO  actix_web::middleware::logger] 127.0.0.1:46718 "GET /pkg/webapp_frontend.js HTTP/1.1" 200 54918 "http://127.0.0.1:30088/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:92.0) Gecko/20100101 Firefox/92.0" 0.000606
[2021-09-20T12:18:37Z INFO  actix_web::middleware::logger] 127.0.0.1:46718 "GET /pkg/webapp_frontend_bg.wasm HTTP/1.1" 200 398618 "http://127.0.0.1:30088/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:92.0) Gecko/20100101 Firefox/92.0" 0.001883
[2021-09-20T12:18:38Z INFO  actix_web::middleware::logger] 127.0.0.1:46718 "GET /favicon.ico HTTP/1.1" 200 198 "http://127.0.0.1:30088/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:92.0) Gecko/20100101 Firefox/92.0" 0.000315

Frontend logs:

❯ make run-frontend
[INFO]: Checking for the Wasm target...
[INFO]: Compiling to Wasm...
   Compiling webapp-frontend v1.0.0 (/home/samja/repos/other/webapp.rs/frontend)
    Finished release [optimized] target(s) in 3.04s
[WARN]: :-) origin crate has no README
[INFO]: License key is set in Cargo.toml but no LICENSE file(s) were found; Please add the LICENSE file(s) to your project directory
[INFO]: Installing wasm-bindgen...
[INFO]: Optimizing wasm binaries with `wasm-opt`...
[INFO]: :-) Done in 9.01s
[INFO]: :-) Your wasm pkg is ready to publish at /home/samja/repos/other/webapp.rs/frontend/pkg.

./main.js → ./pkg/webapp_frontend.js...
created ./pkg/webapp_frontend.js in 315ms
Serving HTTP on 0.0.0.0 port 8000 (http://0.0.0.0:8000/) ...