Questions tagged [rocket]

Rocket is a new container runtime, designed for composability, security, and speed. Do not use this tag for the [rust] web framework, use [rust-rocket] instead. Do not use this for Rocket Software products, use appropriate product-specific tag such as [rocket-u2], [unidata], [universe], etc

Rocket is an alternative to the runtime, designed for server environments with the most rigorous security and production requirements. Rocket is oriented around the App Container specification, a new set of simple and open specifications for a portable container format.

74 questions
0
votes
0 answers

WP Rocket is making my site to get a white page every time i update pictures or text

So i have Wp rocket on my site and i saw that every time i modify a image or a text from my site, the homepage appears white with only the cookie icon visible.... i have to delete cache each time this happens and also i have to check page every…
Jose
  • 1
0
votes
0 answers

Reached the recursion limit while auto-dereferencing

I'm working on code to set up multiple database connections, which takes a subdomain and domain as inputs, looks to see if it already has a connection there, and, if not, creates and returns it. If I hardcode the creation of the connections, it…
Mike Mannakee
  • 361
  • 1
  • 5
0
votes
0 answers

Displaying a vector of structs in a html.tera page with rocket web framework

Hello i can't figure out how to display a vector of struct. template rendering: let a: Vec = serde_json::from_value(query_result).unwrap(); Template::render("index", json!({ "user": user, "c_api": c_api, "query_result": a…
GranBoh
  • 67
  • 8
0
votes
1 answer

Need to know the exact differences between the docker, rocket and CRIO

We have docker, rocket and CRIO as OCIs . what is the main differences between docker , rocket and CRIO ? why only docker is most popular ? what is the reason behind the same ? Anticipating your responses what is the main differences between docker…
0
votes
0 answers

Is there a way to return the Client object from this function?

This is my async function that uses rust to connect to an existing mongoDB database. Is there a way to return / export the client variable / object and make it usable in other Files / Functions? async fn connect_to_db() -> Result<(), Box>…
Wadafacc
  • 3
  • 2
0
votes
2 answers

How do I serve a static HTML at API endpoint using Rocket?

I want to serve a simple HTML file as a response to a request to an API endpoint like / or api/. The only thing I have managed to find online is how to host the a static file as /index.html for example.
TheEyeOfAr3s
  • 128
  • 8
0
votes
0 answers

How do i configure rocket to start REDIS with a password from an environment variable inside the Rocket.toml file?

I swear this is the hardest thing to find on the internet. My Redis instance has a password. How do i configure this from an environment variable in the Rocket.toml file? Here is what i have inside Rocket.toml. And it works perfectly if redis has no…
Just a coder
  • 15,480
  • 16
  • 85
  • 138
0
votes
1 answer

How do I display a html webpage by giving the link with rocket.rs

I am able to make a html webpage but with the html code in my .rs file. How do I separate it giving a link to the file to be displayed to rocket.rs? My code: use rocket::*; use rocket::response::content::RawHtml; #[get("/")] fn index() ->…
0
votes
2 answers

How do I display html files with rocket.rs

I am new to rust and I am trying to build a simple webpage with HTML. This is my code: use rocket::*; use rocket::response::content::Html; #[get("/")] fn index() -> content::Html<&'static str> { content::Html(r#" GCD…</div> <div class="grid ai-start jc-space-between fw-wrap"> <div class="grid gs4 fw-wrap tags "> <a href="../../questions/tagged/web" class="post-tag grid--cell" title="show questions tagged 'web'" rel="tag">web</a> <a href="../../questions/tagged/rust" class="post-tag grid--cell" title="show questions tagged 'rust'" rel="tag">rust</a> <a href="../../questions/tagged/rocket" class="post-tag grid--cell" title="show questions tagged 'rocket'" rel="tag">rocket</a> </div> <div class="started mt0"> <div class="s-user-card s-user-card"> <time class="s-user-card--time" datetime="asked Jun 29 '22 at 04:55">asked Jun 29 '22 at 04:55</time> <a href="../../users/15957376/gaurav-chandrashekar" class="s-avatar s-avatar__32 s-user-card--avatar"> <img class="s-avatar--image" src="../../users/profiles/15957376.webp" data-jdenticon-width="32" data-jdenticon-height="32" data-jdenticon-value="Gaurav Chandrashekar" /> </a> <div class="s-user-card--info"> <a href="../../users/15957376/gaurav-chandrashekar" class="s-user-card--link">Gaurav Chandrashekar</a> <ul class="s-user-card--awards"> <li class="s-user-card--rep" title="reputation score">25</li> <li class="s-award-bling s-award-bling__bronze" title="4 bronze badges">4</li> </ul> </div> </div> </div> </div> </div> </div> </div> <div class="mln24"> <div class="question-summary" id="question-summary-72722363"> <div class="statscontainer"> <div class="stats"> <div class="vote"> <div class="votes"> <span class="vote-count-post"><strong>0</strong></span> <div class="viewcount">votes</div> </div> </div> <div class="status answered-accepted"> <strong>1</strong> answer </div> </div> </div> <div class="summary"> <h3><a href="../../questions/72722363/how-fix-corsoptions-for-rocket" class="question-hyperlink">How fix CorsOPTIONS for Rocket</a></h3> <div class="excerpt">I found this solution for my problem on rocket_cors: use rocket::http::Method; use rocket_cors::{AllowedOrigins, CorsOptions}; let cors = CorsOptions::default() .allowed_origins(AllowedOrigins::all()) .allowed_methods( …</div> <div class="grid ai-start jc-space-between fw-wrap"> <div class="grid gs4 fw-wrap tags "> <a href="../../questions/tagged/rust" class="post-tag grid--cell" title="show questions tagged 'rust'" rel="tag">rust</a> <a href="../../questions/tagged/rocket" class="post-tag grid--cell" title="show questions tagged 'rocket'" rel="tag">rocket</a> </div> <div class="started mt0"> <div class="s-user-card s-user-card"> <time class="s-user-card--time" datetime="asked Jun 22 '22 at 21:47">asked Jun 22 '22 at 21:47</time> <a href="../../users/17777469/martyr" class="s-avatar s-avatar__32 s-user-card--avatar"> <img class="s-avatar--image" src="../../users/profiles/17777469.webp" data-jdenticon-width="32" data-jdenticon-height="32" data-jdenticon-value="martyr" /> </a> <div class="s-user-card--info"> <a href="../../users/17777469/martyr" class="s-user-card--link">martyr</a> <ul class="s-user-card--awards"> <li class="s-user-card--rep" title="reputation score">99</li> <li class="s-award-bling s-award-bling__silver" title="1 silver badges">1</li> <li class="s-award-bling s-award-bling__bronze" title="8 bronze badges">8</li> </ul> </div> </div> </div> </div> </div> </div> </div> <div class="mln24"> <div class="question-summary" id="question-summary-72452318"> <div class="statscontainer"> <div class="stats"> <div class="vote"> <div class="votes"> <span class="vote-count-post"><strong>0</strong></span> <div class="viewcount">votes</div> </div> </div> <div class="status answered-accepted"> <strong>1</strong> answer </div> </div> </div> <div class="summary"> <h3><a href="../../questions/72452318/render-template-rust-rocket-handlebars" class="question-hyperlink">Render Template Rust Rocket Handlebars</a></h3> <div class="excerpt">I am trying to render a template with rust rocket and handlebars, this works fine but I can't get any arguments to the html file to work, the page loads, but the argument is not there. I am familiar with flask and jinja for python but not as much…</div> <div class="grid ai-start jc-space-between fw-wrap"> <div class="grid gs4 fw-wrap tags "> <a href="../../questions/tagged/rust" class="post-tag grid--cell" title="show questions tagged 'rust'" rel="tag">rust</a> <a href="../../questions/tagged/rocket" class="post-tag grid--cell" title="show questions tagged 'rocket'" rel="tag">rocket</a> </div> <div class="started mt0"> <div class="s-user-card s-user-card"> <time class="s-user-card--time" datetime="asked May 31 '22 at 18:03">asked May 31 '22 at 18:03</time> <a href="../../users/18543009/john-hill" class="s-avatar s-avatar__32 s-user-card--avatar"> <img class="s-avatar--image" src="../../users/profiles/18543009.webp" data-jdenticon-width="32" data-jdenticon-height="32" data-jdenticon-value="John Hill" /> </a> <div class="s-user-card--info"> <a href="../../users/18543009/john-hill" class="s-user-card--link">John Hill</a> <ul class="s-user-card--awards"> <li class="s-user-card--rep" title="reputation score">51</li> <li class="s-award-bling s-award-bling__bronze" title="5 bronze badges">5</li> </ul> </div> </div> </div> </div> </div> </div> </div> <div class="mln24"> <div class="question-summary" id="question-summary-72066370"> <div class="statscontainer"> <div class="stats"> <div class="vote"> <div class="votes"> <span class="vote-count-post"><strong>0</strong></span> <div class="viewcount">votes</div> </div> </div> <div class="status "> <strong>0</strong> answers </div> </div> </div> <div class="summary"> <h3><a href="../../questions/72066370/why-the-rust-rocket-auto-lower-case-the-http-header" class="question-hyperlink">why the rust rocket auto lower case the http header</a></h3> <div class="excerpt">when I using this command to requst the rust rocket rocket = { version = "0.5.0-rc.1", features = ["json"] } server: curl 'http://127.0.0.1:8000/manage/app/cruise/channel/v1/page' \ -H 'Accept: */*' \ -H 'Accept-Language:…</div> <div class="grid ai-start jc-space-between fw-wrap"> <div class="grid gs4 fw-wrap tags "> <a href="../../questions/tagged/rust" class="post-tag grid--cell" title="show questions tagged 'rust'" rel="tag">rust</a> <a href="../../questions/tagged/rocket" class="post-tag grid--cell" title="show questions tagged 'rocket'" rel="tag">rocket</a> </div> <div class="started mt0"> <div class="s-user-card s-user-card"> <time class="s-user-card--time" datetime="asked Apr 30 '22 at 06:59">asked Apr 30 '22 at 06:59</time> <a href="../../users/2628868/dolphin" class="s-avatar s-avatar__32 s-user-card--avatar"> <img class="s-avatar--image" src="../../users/profiles/2628868.webp" data-jdenticon-width="32" data-jdenticon-height="32" data-jdenticon-value="Dolphin" /> </a> <div class="s-user-card--info"> <a href="../../users/2628868/dolphin" class="s-user-card--link">Dolphin</a> <ul class="s-user-card--awards"> <li class="s-user-card--rep" title="reputation score">29,069</li> <li class="s-award-bling s-award-bling__gold" title="61 gold badges">61</li> <li class="s-award-bling s-award-bling__silver" title="260 silver badges">260</li> <li class="s-award-bling s-award-bling__bronze" title="539 bronze badges">539</li> </ul> </div> </div> </div> </div> </div> </div> </div> <div class="mln24"> <div class="question-summary" id="question-summary-71358173"> <div class="statscontainer"> <div class="stats"> <div class="vote"> <div class="votes"> <span class="vote-count-post"><strong>0</strong></span> <div class="viewcount">votes</div> </div> </div> <div class="status "> <strong>1</strong> answer </div> </div> </div> <div class="summary"> <h3><a href="../../questions/71358173/how-to-get-user-data-from-html-form" class="question-hyperlink">How to get user data from HTML form?</a></h3> <div class="excerpt">I am writing a Rust web app using Rocket and Handlebars. In my main.rs, I render a Handlebars template. In that template, I have a form. When the user enters in their information and presses "submit", I want to send that user input to another…</div> <div class="grid ai-start jc-space-between fw-wrap"> <div class="grid gs4 fw-wrap tags "> <a href="../../questions/tagged/html" class="post-tag grid--cell" title="show questions tagged 'html'" rel="tag">html</a> <a href="../../questions/tagged/rust" class="post-tag grid--cell" title="show questions tagged 'rust'" rel="tag">rust</a> <a href="../../questions/tagged/handlebars.js" class="post-tag grid--cell" title="show questions tagged 'handlebars.js'" rel="tag">handlebars.js</a> <a href="../../questions/tagged/rocket" class="post-tag grid--cell" title="show questions tagged 'rocket'" rel="tag">rocket</a> </div> <div class="started mt0"> <div class="s-user-card s-user-card"> <time class="s-user-card--time" datetime="asked Mar 04 '22 at 23:14">asked Mar 04 '22 at 23:14</time> <a href="../../users/10982955/user545642" class="s-avatar s-avatar__32 s-user-card--avatar"> <img class="s-avatar--image" src="../../users/profiles/10982955.webp" data-jdenticon-width="32" data-jdenticon-height="32" data-jdenticon-value="user545642" /> </a> <div class="s-user-card--info"> <a href="../../users/10982955/user545642" class="s-user-card--link">user545642</a> <ul class="s-user-card--awards"> <li class="s-user-card--rep" title="reputation score">91</li> <li class="s-award-bling s-award-bling__silver" title="1 silver badges">1</li> <li class="s-award-bling s-award-bling__bronze" title="14 bronze badges">14</li> </ul> </div> </div> </div> </div> </div> </div> </div> <div class="mln24"> <div class="question-summary" id="question-summary-70340680"> <div class="statscontainer"> <div class="stats"> <div class="vote"> <div class="votes"> <span class="vote-count-post"><strong>0</strong></span> <div class="viewcount">votes</div> </div> </div> <div class="status answered-accepted"> <strong>1</strong> answer </div> </div> </div> <div class="summary"> <h3><a href="../../questions/70340680/cannot-trigger-outcome-failure-in-fromrequest-implementation" class="question-hyperlink">Cannot trigger Outcome::Failure in FromRequest implementation</a></h3> <div class="excerpt">While trying to get started with development of an api using rocket, I was implementing a request guard which is supposed to check authorization headers. When the check fails it should result in a Failure, but that is where I cannot get it to work.…</div> <div class="grid ai-start jc-space-between fw-wrap"> <div class="grid gs4 fw-wrap tags "> <a href="../../questions/tagged/rust" class="post-tag grid--cell" title="show questions tagged 'rust'" rel="tag">rust</a> <a href="../../questions/tagged/rocket" class="post-tag grid--cell" title="show questions tagged 'rocket'" rel="tag">rocket</a> </div> <div class="started mt0"> <div class="s-user-card s-user-card"> <time class="s-user-card--time" datetime="asked Dec 13 '21 at 20:43">asked Dec 13 '21 at 20:43</time> <a href="../../users/11613186/timo" class="s-avatar s-avatar__32 s-user-card--avatar"> <img class="s-avatar--image" src="../../users/profiles/11613186.webp" data-jdenticon-width="32" data-jdenticon-height="32" data-jdenticon-value="Timo" /> </a> <div class="s-user-card--info"> <a href="../../users/11613186/timo" class="s-user-card--link">Timo</a> <ul class="s-user-card--awards"> <li class="s-user-card--rep" title="reputation score">429</li> <li class="s-award-bling s-award-bling__silver" title="3 silver badges">3</li> <li class="s-award-bling s-award-bling__bronze" title="12 bronze badges">12</li> </ul> </div> </div> </div> </div> </div> </div> </div> <div class="mln24"> <div class="question-summary" id="question-summary-68647509"> <div class="statscontainer"> <div class="stats"> <div class="vote"> <div class="votes"> <span class="vote-count-post"><strong>0</strong></span> <div class="viewcount">votes</div> </div> </div> <div class="status answered-accepted"> <strong>1</strong> answer </div> </div> </div> <div class="summary"> <h3><a href="../../questions/68647509/referencing-and-dereferencing-a-db-connection-in-rust" class="question-hyperlink">Referencing and dereferencing a db connection in rust</a></h3> <div class="excerpt">My question is about dereferencing and referencing in rust. I have the following code: #[database("pg_db")] struct PgDbConn(diesel::PgConnection); fn main() { rocket::ignite() .attach(PgDbConn::fairing()) .mount("/",…</div> <div class="grid ai-start jc-space-between fw-wrap"> <div class="grid gs4 fw-wrap tags "> <a href="../../questions/tagged/rust" class="post-tag grid--cell" title="show questions tagged 'rust'" rel="tag">rust</a> <a href="../../questions/tagged/rust-diesel" class="post-tag grid--cell" title="show questions tagged 'rust-diesel'" rel="tag">rust-diesel</a> <a href="../../questions/tagged/rocket" class="post-tag grid--cell" title="show questions tagged 'rocket'" rel="tag">rocket</a> </div> <div class="started mt0"> <div class="s-user-card s-user-card"> <time class="s-user-card--time" datetime="asked Aug 04 '21 at 07:58">asked Aug 04 '21 at 07:58</time> <a href="../../users/536299/balteo" class="s-avatar s-avatar__32 s-user-card--avatar"> <img class="s-avatar--image" src="../../users/profiles/536299.webp" data-jdenticon-width="32" data-jdenticon-height="32" data-jdenticon-value="balteo" /> </a> <div class="s-user-card--info"> <a href="../../users/536299/balteo" class="s-user-card--link">balteo</a> <ul class="s-user-card--awards"> <li class="s-user-card--rep" title="reputation score">23,602</li> <li class="s-award-bling s-award-bling__gold" title="63 gold badges">63</li> <li class="s-award-bling s-award-bling__silver" title="219 silver badges">219</li> <li class="s-award-bling s-award-bling__bronze" title="412 bronze badges">412</li> </ul> </div> </div> </div> </div> </div> </div> </div> <div class="s-pagination pager fr"> <a class="s-pagination--item" href="../../questions/tagged/rocket_page=3" rel="prev" title="Go to page 3">Prev </a> <a class="s-pagination--item" href="../../questions/tagged/rocket_page=1" rel="" title="Go to page 1">1</a> <a class="s-pagination--item" href="../../questions/tagged/rocket_page=2" rel="" title="Go to page 2">2</a> <a class="s-pagination--item" href="../../questions/tagged/rocket_page=3" rel="" title="Go to page 3">3</a> <div class="s-pagination--item is-selected">4</div> <a class="s-pagination--item" href="../../questions/tagged/rocket_page=5" rel="" title="Go to page 5">5</a> <a class="s-pagination--item" href="../../questions/tagged/rocket_page=5" rel="next" title="Go to page 5"> Next</a> </div> </div> </div> </div> </div> <script src="../../static/js/stack-icons.js"></script> <script src="../../static/js/fromnow.js"></script> </body> </html>