Comments (4)
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.
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.
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.
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)
- trillium-static should respect If-None-Match and ETag and return no content if it matches HOT 4
- Cannot run nesting router example HOT 2
- Feature suggestion for `trillium-websockets`: Make websocket limits configurable HOT 3
- `trillium-http`: Incorrect handling of http chunks longer than u32::MAX on 32 bit platforms.
- Feature suggestion for `trillium-tera`: live reload (development-mode)
- Feature suggestion for `trillium-router`: Allow `String` or `&str` to be used as the path HOT 3
- Bug report for `trillium-async-std`: Ctrl-C crashes the server on Windows
- feature for all runtime adapters: add the ability to provide a pre-bound TcpListener instead of host+port
- Bug report for `trillium-testing & trillium-static`: Documentation is failing to build on docs.rs HOT 1
- Bug report for `trillium-method-override`: Not converting from method field in request body HOT 4
- allow to send static compiled file when 404 HOT 8
- Integration with Tracing HOT 1
- Bug report for `trillium`: Conn does not provide access to the `peer_ip` method HOT 1
- Feature suggestion for `trillium-websocket`: Add access to peer_ip from WebSocketConn HOT 4
- trillium on io-uring HOT 1
- Feature suggestion for `trillium-api`: ApiConnExt should include is_json_request() HOT 1
- add set_json in trillium::ApiConnExt HOT 1
- Feature suggestion for `trillium-server-common`: init with TcpListener rather than host and port HOT 2
- Feature suggestion for `trillium`: Lifetimes of Headers::get should be more flexible HOT 1
- Bug report for `trillium`: Headers::get_values is case-sensitive for unknown header names
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from trillium.