leptos-rs / start-actix

Starter template for use with the Leptos web framework.
The Unlicense
122 stars 31 forks source link

Unclear what to do after creating template project - improve readme starter template #2

Closed joepio closed 1 year ago

joepio commented 1 year ago

Hi there! Really cool project :)

I've succesfully installed the cargo leptos cli and created a new project using cargo leptos new --git https://github.com/leptos-rs/start.

The readme skips any command to serve the project itself - the readme should probably also contain some instructions for what to do afterwards.

I kind of assumed cargo leptos watch would be the next command.

However, after running that, I still don't know where the app itself is hosted:

Finished dev [unoptimized + debuginfo] target(s) in 0.11s
       Cargo finished cargo build --package=example --bin=example --target-dir=target/server --no-default-features
    Finished dev [unoptimized + debuginfo] target(s) in 0.24s
       Cargo finished cargo build --package=example --lib --target-dir=target/front --target=wasm32-unknown-unknown --no-default-features

There's no address or port number. The --help or readme.md also doesn't provide a default port. I found 3000 in the source, but that didn't work.

Maybe this issue should be split up in:

gbj commented 1 year ago

Thanks. It should be available at localhost:3000 if you're running cargo leptos watch or cargo leptos serve

See here for where it's set https://github.com/leptos-rs/start/blob/df3dbd6443ac43cd6df9c85bc46debd543ac333d/src/server/mod.rs#L69-L74

There are some pending changes to the template, so I will improve the Readme once those are made.

joepio commented 1 year ago

Thanks for the quick reply!

I tried visiting 127.0.0.1:3000, but no luck.

Also, I don't see the serving at ... message, so I guess for some reason that part of the code is not executed. I suppose the server is simply not running after cargo leptos watch here.

gbj commented 1 year ago

What cargo-leptos version are you using (cargo-leptos --version)? If it's 0.1.0 (which just came out this morning) then I just haven't had time to update this template yet... except a new version of the template in the next few minutes, I'm just finishing updating it.

joepio commented 1 year ago

It's 0.1.0

gbj commented 1 year ago

Got it. Yeah, you caught me in the couple hours between a breaking change in cargo-leptos and my updating the template.

It should be working now if you start over, but let me know if there are further issues.

joepio commented 1 year ago

Thanks again! Doesn't work yet though:

I just retried cargo leptos new --git https://github.com/leptos-rs/start and cargo leptos watch and now get:

    Finished dev [unoptimized + debuginfo] target(s) in 29.18s
       Cargo finished cargo build --package=leptos-start --bin=leptos-start --target-dir=target/server --no-default-features --features=ssr
Error: Could not create "/pkg/pkg" at `/Users/joep/.cargo/registry/src/github.com-1ecc6299db9ec823/cargo-leptos-0.1.0/src/ext/fs.rs:58:10`

Caused by:
    Read-only file system (os error 30)
gbj commented 1 year ago

Could you open an issue over on the cargo-leptos repo? I don't actually maintain cargo-leptos itself so he may need to help over there. I'll add a note to the Readme that this is currently broken.

joepio commented 1 year ago

Could you open an issue over on the cargo-leptos repo? I don't actually maintain cargo-leptos itself so he may need to help over there. I'll add a note to the Readme that this is currently broken.

Yes, done: https://github.com/akesson/cargo-leptos/issues/36

gbj commented 1 year ago

Okay, sorry about that; the latest version here should be working, after I've reverted some updates that broke things.

joepio commented 1 year ago

It's working! :D Thanks