Questions tagged [iron]

Iron is a extensible web framework for Rust.

120 questions
1
vote
3 answers

Meteor server api using iron router returns HTML not the response

I have a simple Meteor app just the basic meteor create test. I want to be able to route traffic to the "/" directory to a template. I want to be able to route data from a facebook web-hook to a simple js response. My issue is that when I fire the…
1
vote
1 answer

Loading Iron Ruby DSL files on demand

Currently I have an application that stores metadata information written in a boo internal DSL. I store the metadata in seperate .boo files that I load if and when I need them like this: IConfigReader reader = factory.Create(BUILD_FILE_NAME); I…
dagda1
  • 26,856
  • 59
  • 237
  • 450
1
vote
2 answers

How to flip iron-icon vertically in css

I'm using iron-icon components for my Polymer 2 application, and I want to know how to flip these icons vertically or horizontally? I've tried the transform attribute and equivalent for other browsers, but it didn't work for me. as…
getName
  • 693
  • 1
  • 9
  • 19
1
vote
1 answer

How do I create a custom Content-Type with Iron?

I want to create the header Content-Type: application/x-protobuf in my Iron web app. I can see from the Iron docs that it's possible to construct content-types, but there's no SubLevel that corresponds to protobuf. How can I create this…
Synesso
  • 37,610
  • 35
  • 136
  • 207
1
vote
0 answers

How does one inject dependencies like a logger, database connection, or SHA256 generator in Iron?

I picked an example from Iron router extension and tried to add a single SHA256 hash generator instance that could be used throughout the lifetime of the server: extern crate crypto; extern crate iron; extern crate router; use iron::prelude::*; use…
rusty doe
  • 23
  • 2
1
vote
1 answer

Iron.seal does not work when user log in

Iron.seal does not work on updating npm module Iron ,that's why I faced this issue on log in the user var obj = { a: 1, b: 2, c: [3, 4, 5], d: { e: 'f' } }; var password =…
1
vote
1 answer

Share session information to iron handler

I'm trying to implement a web API using Iron as a practical exercise. My session is the following struct, which will be encoded as a JWT. Every time I receive requests from clients, some handlers will need to access user_id; #[derive(Serialize,…
Danilo
  • 93
  • 11
1
vote
0 answers

Rust Iron Web Framework gives some phantom error

I am using iron. Most of time like 99.* % all is good. But sometimes I get error like Error was: ErrorImpl { code: EofWhileParsingString/List/Object, line: 1, column: 8186 } or InvalidUnicodeCodePoint. I am printing request in log and when i try…
Vishal Kumar
  • 762
  • 1
  • 7
  • 15
1
vote
1 answer

Iron renders html as text

A part of my Iron web application: lazy_static! { pub static ref TEMPLATES: Tera = { let mut tera = compile_templates!("templates/**/*"); tera.autoescape_on(vec!["html", ".sql"]); tera }; } fn index(_: &mut Request)…
Posh344
  • 43
  • 1
  • 1
  • 5
1
vote
1 answer

Append HTML in the polymer

Here is my html
and here i am appending from js this.addedImages = { imageURL : self.downloadURL }; this.$.setImgWrap.append('
Abhay Sharma
  • 221
  • 1
  • 7
  • 24
1
vote
2 answers

Trouble to pass Iron handlers with closure in the router declaration

I'm trying to declare my routes with closures: use mongodb::Client; pub fn get_user_routes(client: Client) -> Router { let controller = controller::UserController::new(client); let handler = handlers::UserHandler::new(controller); …
NotBad4U
  • 1,502
  • 1
  • 16
  • 23
1
vote
1 answer

"macro undefined" error while compiling hyper 0.9.17

I'm trying to build a web service with Iron using this source as a tutorial, but I'm getting errors during compilation of hyper: Compiling hyper…
dnlkng
  • 829
  • 1
  • 10
  • 16
1
vote
1 answer

Curl can connect to an Iron server on localhost, but Scala intermittently cannot

In my Rust app, I start Iron like so: let host: &str = &format!("localhost:{}", port); info!("Server running at http://{}", host); Iron::new(Chain::new(router)).http(host).expect("Could not start Iron server"); It responds: INFO Server running at…
Synesso
  • 37,610
  • 35
  • 136
  • 207
1
vote
2 answers

Unable to compile Iron example: expected struct `iron::request::Request`, found struct `iron::Request`

I'm trying to get a simple Iron example to work: extern crate iron; extern crate router; use iron::prelude::*; use iron::status; use router::Router; fn main() { let mut router = Router::new(); router.get("/controller", controller); …
Thijs
  • 13
  • 3
1
vote
1 answer

Access to file path on form upload with Iron Params

I tried to get the temporary path of an uploaded file using Iron params. I have this request handler: fn handler(req: &mut Request) -> IronResult { let tmp_file_name = req.get_ref::().unwrap().find(&["file"]).unwrap(); …
rap-2-h
  • 30,204
  • 37
  • 167
  • 263