ntex-rs / examples Goto Github PK
View Code? Open in Web Editor NEWLicense: Apache License 2.0
License: Apache License 2.0
Thanks for such a great private project and it seems a little issue on example/async_pg when I followed README steps
pub async fn add_user(client: &Client, user_info: User) -> Result<User, MyError> {
...
let stmt = client.prepare(&_stmt).await.unwrap(); // <- thread 'ntex-rt:worker:0' panicked at 'there is no reactor running
...
here is the detail error
[2021-07-22T05:32:14Z TRACE ntex::http::h1::dispatcher] http message is received:
Request HTTP/1.1 POST:/user
headers:
"host": "localhost:8080"
"user-agent": "HTTPie/2.4.0"
"connection": "keep-alive"
"accept": "application/json, */*;q=0.5"
"content-type": "application/json"
"content-length": "126"
"accept-encoding": "gzip, deflate"
and payload Payload(PayloadDecoder { kind: Cell { value: Length(126) } })
[2021-07-22T05:32:14Z TRACE ntex::http::h1::decoder] Length read: 126
thread 'ntex-rt:worker:0' panicked at 'there is no reactor running, must be called from the context of a Tokio 0.2.x runtime', /Users/orlowang/.cargo/registry/src/github.com-1ecc6299db9ec823/tokio-0.2.25/src/io/driver/mod.rs:203:30
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
Do you have an example of how to get the value of x
for a query like /?x=abc
?
In https://github.com/ntex-rs/examples/tree/master/basics you reference crate "ntex-files" which I cannot find under https://github.com/rust-lang/crates.io-index/tree/master/nt/ex
stdout : Updating crates.io index
error: no matching package named `ntex-files` found
location searched: registry `https://github.com/rust-lang/crates.io-index`
Is it work in progress? If so, is there an alternative example how to serve a binary file?
Is there a way to set the header Access-Control-Allow-Origin: *
for all resources, without going with_header
on each and every one of them?
Before the most recent version change, it was possible to access the underlying transport, and extract the X.509 client certificates from it.
Now, there is is Io<Sealed>
type, which is also used by the IoBoxed
type (which is being used by the Mqtt implementation). However, there seems to be no way to get access to the certificates.
The way to acquire them differs between rustls
and openssl
, so previously we had a trait to abstract this, and added the trait to all requirements of the Io
type parameter.
I guess the new way would be to implement a Filter::query
method to retrieve the certificates. And the TlsServerFilter
should provide an implementation which returns them.
Is there an example of what would be the NTEX equivalent of the following express.js code:
app.get('/names', (req, res) => {
names = ['John', 'Jack', 'James'];
res.setHeader('Content-Type', 'application/json')
res.send(JSON.stringify(names))
})
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.