Iron is a extensible web framework for Rust.
Questions tagged [iron]
120 questions
0
votes
0 answers
Can I parse JSON with empty fields with Iron's bodyparser?
I'm writing a simple REST API using Iron. There is an endpoint that parses incoming JSON into a structure. Not all fields of the structure are mandatory, some can be omitted. I'm trying to parse JSON with the bodyparser crate like this
let body =…

elgris
- 516
- 4
- 13
0
votes
1 answer
Parsing an url in Iron and getting a dynamic part
I have 2 routes in Iron:
/something/:some_int # integer
/something2/:some_str # string
How can I get these :some_{int, str} parts of them?
fn my_something_int_route_handler(req: &mut Request) -> IronResult {
let ref query =…

Joharu
- 1
- 2
0
votes
1 answer
How to serve a fallback file using Iron's staticfile when the original file is not found?
I'm using Iron to serve a React site. I'm trying to get it to serve index.html if the file or directory does not exist.
fn staticHandler(req: &mut Request) -> IronResult {
let url = Url::parse("http://localhost:1393").unwrap();
let…

FIL1994
- 23
- 6
0
votes
1 answer
Nested Iron Ajax
Ok. So my last post was too ambiguous. For my second post, let me try to approach the same problem in hopefully a little more straighforward manner. Below is the code. Here is a screenshot of the results I get. Regarding the second iron-ajax call,…

Alex Hargrove
- 1
- 3
0
votes
1 answer
How can I generate a link to a particular route in Iron?
There's a table with a list of user on an html page. How can I generate a link to a page where I show an information about a single user?
"/users/:user_name" ?
I can hard-code it, of course. But I want to be safer by generating with help of Iron.

Quma
- 15
- 4
0
votes
0 answers
Diagnosing IronPython StackOverflowException
I have a program that essentially reads a temp sensor and writes the readings to a file in an infinite loop (i.e. keep running until I crash/exit the program). Worked great on first machine - Iron Python 2.7, MS Visual Studio 2015 and Win 7…

DyTech
- 159
- 1
- 9
0
votes
0 answers
Switching from iron router to flow router
I'm new to meteor and coding in general. I need to change this to flow router so that I can get the comments to work(I guess). Does anyone want to lend a hand?
Router.map(function () {
this.route('post/:id', {
waitOn: function() {
…

JEEBUS
- 1
- 3
0
votes
0 answers
Iterating over a Map with template in Polymer
I tested Polymer yesterday. Its quite cool, but I wonder how I can read a Map with . Is this possible?
I created an ajax-call to a read url where I get a Map> as response. I want to…

Alex
- 21
- 4
0
votes
2 answers
Meteor: Iron route not to the right route
So I've a navbar, and I've made my way to a sub dir in "Games" called "Cross" so, /games/cross. Now from that page, I'm trying to acess the Games page again from navbar but its showing /games/games... How do I fix this? I have the…

Farhan
- 37
- 1
- 8
0
votes
1 answer
Polymer iron-list add item in the list then select the newly added item
I have a list of items listed using iron-list.
The items in the iron-list are expandable, for every item there is an edition form.
There is also the possibility of creating a new item by pressing a general 'Add' button. Then, a new item will be…

gabriela
- 285
- 1
- 2
- 12
0
votes
0 answers
Delay iron route - Meteor
I'm using Iron Router and I want to add an animation on the loading template. So I did a transition which takes 1400ms.
Some loading time are faster than the 1400ms and mess up with the animation logic.
So, I want to make loading time take at least…

Louis XIV
- 2,224
- 13
- 16
0
votes
1 answer
BeforeMiddleware implementation requires core::ops::Fn implementation
I am trying to implement the BeforeMiddleware trait for a struct I have. I have written the following code:
impl BeforeMiddleware for Auth {
fn before(&self, _: &mut Request) -> IronResult<()> {
println!("before called");
Ok(())
…

russoue
- 5,180
- 5
- 27
- 29
0
votes
2 answers
Set timeout to layoutTemplate meteor / iron
I've been struggling to set 3 seconds timeout for my loadingTemplate.
Using the code bellow loadingTemplate is rendered but it does redirect to layoutTemplate after passing 3 seconds, as I expect.
Please find bellow my code and comments issues.
I…

natali
- 125
- 2
- 9
0
votes
0 answers
Read::read_to_end ignores whitespace when reading markdown
My function is as follows:
fn read_file () -> String {
let mut file = File::open("./assets/postdata/lorem_ipsum.md").unwrap();
let mut buffer = Vec::new();
let read_variable = file.read_to_end(&mut buffer).unwrap();
let filestr =…

NecroTechno
- 301
- 1
- 2
- 9
0
votes
0 answers
How to clear all yields when route is changed in iron-router
Iron router allows to render different content into layout template, or load smaller templates into yields, but when user goes to different path, a content from previous yields does not unload templates inside them, until you force router to render…

Dariusz Sikorski
- 4,309
- 5
- 27
- 44