Questions tagged [iron]

Iron is a extensible web framework for Rust.

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,…
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