Wulf / create-rust-app

Set up a modern rust+react web app by running one command.

Home Page:https://create-rust-app.dev

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Cannot get an additional module to work - [backend] TEMPLATE_FILE

kirtcathey opened this issue · comments

I created another service and model, then wired the frontend. Basically, I made a copy of todo with different data fields/struct (only slightly) diesel creates the database and runs the creates the schema, and no compile errors show in the rust or ts code.... The add button in my app (think the todo add button) stays disabled, so may not be connecting to the database. But in the console this appears when I click the button to navigate to that part of the webapp.

[backend] TEMPLATE_FILE /api/vulns => index.html
[backend] [2022-10-29T10:05:00Z INFO actix_web::middleware::logger] 127.0.0.1 "GET /api/vulns?page=0&page_size=5 HTTP/1.1" 200 646 "http://127.0.0.1:3000/vulns"

Any ideas or help would be appreciated.

Also, noticed this popping up in the console right above then above output:

[backend] [2022-10-29T10:32:29Z INFO actix_web::middleware::logger] 127.0.0.1 "GET /api/development/db/needs-migration HTTP/1.1" 200 25

However, I have gone through the diesel migration commands... is there some order that I am not following when building out my own app?

Thank you!

commented

@kirtcathey thanks for reporting this -- my first guess is that you forgot to add a route for /vulns to main.rs

Would you mind publishing the changes you made on github? I can take a better look then.

Found it! It was in routing in the services file for the new module. had slashes at #[get("")] and #[post("")] where I didn't need them.

commented

awesome, great to hear :)