Giter Site home page Giter Site logo

Comments (4)

jbr avatar jbr commented on June 28, 2024 1

This behavior exists, and has been tested with https://crates.io/crates/catflap, but the documentation is insufficient. https://docs.trillium.rs/trillium_server_common/trait.configext#tymethod.build_listener — if a LISTEN_FD env var is available, trillium will use it on cfg(unix) systems

from trillium.

jbr avatar jbr commented on June 28, 2024 1

I'll add this to the guide, although the LISTEN_FD support should not end up being very important because the soon-to-be-released trillium cli includes a hot-reloading dev server.

I think a webpack dev server would be amazing, and looked into using https://github.com/swc-project/swc for this, but haven't been able to get it working yet

from trillium.

jbr avatar jbr commented on June 28, 2024

Although I have nothing against windows, I have no way to test windows locally and so stuff like this and signals support (graceful shutdown) are cfg(unix) only for now

from trillium.

prabirshrestha avatar prabirshrestha commented on June 28, 2024

That is great and example or docs would be great. I have always found it a struggle to find good examples in rust that deals with cargo watch that uses both webpack/react-create-app with rust as server.

I found this to work the best for now in package.json

{
    "scripts": {
        "preinstall": "yarn --cwd client install",
        "build": "yarn client:build && yarn server:build",
        "start": "cross-env BROWSER=none concurrently \"yarn client:start\" \"yarn server:start\"",
        "client:start": "yarn --cwd client start",
        "client:build": "yarn --cwd client build",
        "client:test": "yarn --cwd client test",
        "server:start": "cargo watch -x 'run serve'",
        "server:build": "cargo build --release"
    },
    "devDependencies": {
        "concurrently": "^6.1.0",
        "cross-env": "^7.0.3"
    }
}

with proxy it would simplify here.

trillium_smol::run(
    Router::new()
        .get("/api", api)
        .get("*", Proxy::new("http://localhost:3000"))
);

Or some sort of webpack-dev-server handler.

I'm ok with just unix for now since that is what I use rust mainly on.

from trillium.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.