Rocket on Fedora

This post is a very small example of how you can start creating small web apps with Rocket which extensively uses Rust under the hood. This post will just give an idea about how to get started if you are totally new to rust.

Rocket is a web framework for Rust that makes it simple to write fast web applications without sacrificing flexibility or type safety. All with minimal code. - rocket.rs


Getting started:

Start by installing rust nightly on your system or virtual box:


$ curl -sSf https://static.rust-lang.org/rustup.sh | sh -s -- --channel=nightly


                


Setting up Project and Dependencies:


Setting up the project is easy cas you can go ahead and execute


cargo new hello-rocket --bin

Once the execution is completes , you will have a binary application created with a Cargo.toml file and src dir with main.rs inside it.

For setting up the dependencies you need to update the Cargo.toml file.




Now,it's time to update the source main.rs file with some values to show up when we run the up. In my case , I have given a static str.

 


Compile and Deploy on Local Host:

Deployment is easy , all you need to do is to execute cargo run







Outcome:

Localhost will have the data which in this case the str which I passed.





Comments



  1. 1. The only place where you mention Fedora is title. I don't see how it's relevant that you are using this distro.

    2. It would be much lighter (in size) and more readable if instead of screenshots you would provide source code as text.

    ReplyDelete
  2. Nice information thank you,if you want more information please visit our link selenium Online Training Bangalore

    ReplyDelete
  3. World News :
    View CNN world news latest today for international news and videos from Europe, Asia, Africa, the Middle East and the Americas. Visit CNN News for up-to-the-minute news, breaking news, video, audio and feature stories.

    Politics News :
    Politics at CNN has news, opinion and analysis of American and global politics Find news and video about elections, the White House, the U.N and much more. What You Need To Know About politics news now .

    Business News :
    The latest CNN business news google : breaking personal finance, company, View the latest business news about the world's top companies, and explore articles on global.

    Sports News :
    Latest sports news today football from around the world with in-depth analysis, features, photos and videos covering football, tennis, motorsport, golf, rugby, sailing, skiing, horse racing and equestrian.

    Entertainment News :
    View entertainment news fox and videos for the latest movie, music, TV and celebrity headlines on usacnnnews.com
    Technology News :
    Get the latest CNN technology news mobile : breaking news and analysis on computing, the web, blogs, games, gadgets, social media, broadband and more.

    Science News :
    Get the latest CNN Science and Environment News: breaking news, analysis and debate on science news today and nature in the UK and around the world.

    Health News :
    Get the latest CNN health news review : breaking health and medical news from the UK and around the world, with in-depth features on well-being and lifestyle.

    Daily Life :
    What You Need To Know About daily life yoga ? Get the latest lifestyle news with articles and videos on pets, parenting, fashion, beauty, food, travel, relationships and more on CNN news.

    ReplyDelete
  4. World News :
    View FOX world news today for international news and videos from Europe, Asia, Africa, the Middle East and the Americas. Visit world news msn for up-to-the-minute news, breaking news, video, audio and feature stories.

    Politics News :
    Politics at FOX has news, opinion and analysis of American and global politics Find news and video about elections, the White House, the U.N and much more. What You Need To Know About political news from us.

    Business News :
    The latest FOX Business News: breaking personal finance, company, View the latest business news latest about the world's top companies, and explore articles on global.

    Sports News :
    Latest sports news today football from around the world with in-depth analysis, features, photos and videos covering football, tennis, motorsport, golf, rugby, sailing, skiing, horse racing and equestrian.

    Entertainment News :
    View entertainment news shows and videos for the latest movie, music, TV and celebrity headlines on worldfoxnews.com

    Technology News :
    Get the latest FOX technology news mobile : breaking news and analysis on computing, the web, blogs, games, gadgets, social media, broadband and more.

    Science News :
    Get the latest FOX science news environment and Environment News: breaking news, analysis and debate on science and nature in the UK and around the world.

    Health News :
    Get the latest FOX health news review: breaking health and medical news from the UK and around the world, with in-depth features on well-being and lifestyle.

    Daily Life :
    What You Need To Know About The daily life activities? Get the latest lifestyle news with articles and videos on pets, parenting, fashion, beauty, food, travel, relationships and more on Fox news.

    ReplyDelete
  5. We are best and trusted bangladeshi online news portal website. Everyday we publish the national and international latest news. If you want to get regular newslatter from our newspaper, please go home page BANGLA NEWS and click the below subscribe button.

    বাংলাদেশ :
    Read Bangla Breaking বাংলাদেশ News on Parliament, Govt, Justice, Road Accident, Cricket, Sports, Education, Business, Agriculture, Population, Dhaka at todaybanglenews.com
    রাজধানী :
    রাজধানী ঢাকার সরকার/রাজনীতি, শিক্ষা, বিচার/আদালত, পুলিশ/অপরাধ, বিক্ষোভ/ধর্মঘট/প্রতিবাদ সমাবেশ, গোলাগুলি/আগুন/আহত, প্রেসক্লাব বিষয়ক খবর ও সংবাদ Dhaka news at todaybanglenews.com
    আন্তর্জাতিক :
    আন্তর্জাতিক,Read Bangla Breaking World News on USA, UK, India, Pakistan, Asia, China, Europe, Middle East, Latin America, Africa, Australia, America & UN at todaybanglenews.com
    সম্পাদকীয় :
    সম্পাদকীয় - সংবাদ গবেষণা, বিশ্লেষণ, অভিমত, মতামত, মন্তব্য বিশয়ক ফিচার। প্রথম আলো, বাংলাদেশের সর্বাধিক পঠিত অনলাইন বাংলা সংবাদপত্র/পত্রিকা at todaybanglenews.com
    বিজ্ঞান ও প্রযুক্তি :
    বিজ্ঞান ও প্রযুক্তি বিষয়ক খবর/সংবাদ - Bangla Technology News। কম্পিউটার সফটওয়্যার, ইন্টারনেট, মোবাইল, আইফোন/আইপ্যাড, উইন্ডোজ/মাইক্রোসফট, এনড্রয়েড/গুগল, নকিয়া, আপডেট/আপগ্রেড, গেমস, ফ্রিল্যান্সার বিষয়ে রিভিউ, গবেষণা, ও ফিচার at todaybanglenews.com
    টিপস্ :
    টিপস্, health tips bangla, health tips bangladesh, health tips bangla version, health tips bangla diabetes, health tips bangla language, health tips bangla pregnancy, health tips bangla women, health tips bangla health tips, healthy jibon, পুরুষের স্বাস্থ্য, health tips for human, health tips in bangla at todaybanglenews.com
    বিনোদন খবর :
    বিনোদন খবর ও সংবাদ - Bangla Movie and Entertainment News। ছবি, শুটিং, মঞ্চ, শিল্পী, নাচ বিষয়ক ফিচার। প্রথম আলো, বাংলাদেশের সর্বাধিক পঠিত অনলাইন বাংলা সংবাদপত্র/পত্রিকা at todaybanglenews.com
    খেলাধুলা :
    খেলার খবর/সংবাদ - খেলাধুলা, ক্রীড়া ও ক্রিকেট - Bangla Sports News। ফুটবল, ক্রিকেট, টেনিস, বিশ্বকাপ, শিরোপা, টি-টোয়েন্টি, বল, সেমি-ফাইনাল, বোলার বিষয়ক ফিচার at todaybanglenews.com


    ReplyDelete

Post a Comment

Popular posts from this blog

WebVr in Fedora/RHEL 25 Pre Release

How to create live USB with Fedora Media Writer on Windows 8.1