Rust Web Application using Iron Or Nickel Framework (like a website with multi-page)


#1

Is it possible to write web application (specifically website) using Iron/Nickel and u want to use Angular JS/jQuery ?
Any example code, with atleast 2 page is good all the examples in Iron and Nickel does not look good enough to try (they too simple).


Bundling angular2 application in rust app
#2

You could use nginx to host the static files (html,js,css). Then use iron or nickel to serve a rest api.


#3

It’s definitely doable. Like @ivanceras said you could use a web server to host static files or use iron-mount:

let mut mount = Mount::new();
mount.mount("/css/", Static::new(Path::new("css/")));

I wrote two small web apps for my own purpose (sorry, no fancy Angular or jQuery):

  1. SLURM inspector: https://github.com/willi-kappler/slurm_inspector (I need to update this…)

  2. Conference registration: https://github.com/willi-kappler/conference_registration (Currently working on this.)

The second one shows how to use some of the iron core packages: mount, router, params, persistence. It even sends an e-mail to the user via the lettre crate.

HTH, if you have any more questions, just port them here :wink:


#4

Cool that’s exactly what i wanted to see… I will try out… I love this community… awesome response time!


#5

You’re welcome!

But note that this code is still work in progress, has hard coded stuff in it and is not 100% idiomatic Rust.