Website under construction

New Rohanasantml launched! See what's new

Rohanasan: An extremely fast backend framework

Here at Rohanasan we focus on extreme optimization, performance and ease of use.

Tutorial

Simple hello world program:

This is a basic hello world implementation in Rohanasan backend framework (Rust)


use rohanasan::{
    rohanasan, send_http_response, serve, Request, DEFAULT_HTML_HEADER,
};
fn handle(req: Request) -> String {
    send_http_response(DEFAULT_HTML_HEADER, "

Hello!

", req) } fn main() { rohanasan! { serve(8080, handle) } }
Read more
Design

Solve Complex problems with ease:

An example to send a html file named index.html present inside html folder. It also checks if the request made was a get request or a post request if, the path is / it returns an index.html persent inside ./html directory.


use rohanasan::{
    rohanasan, send_file, send_http_response, serve, url_decode, Request, DEFAULT_HTML_HEADER,
};
fn handle(req: Request) -> String {
    if req.path == "/" {
        send_file(DEFAULT_HTML_HEADER, "./html/hello.html", req)
    } else if req.path == "/hello" {
        send_http_response(DEFAULT_HTML_HEADER, "

Hi, How are you?

", req) } else if req.path == "/req" { if url_decode(req.get_request) == "q=hello world" { send_http_response(DEFAULT_HTML_HEADER, "

Hi world!

", req) } else { send_http_response(DEFAULT_HTML_HEADER, "

World?

", req) } } else { send_file(DEFAULT_HTML_HEADER, "./html/404.html", req) } } fn main() { rohanasan! { serve(8080, handle) } }
Read more
Code

How to create your own project?

Just follow the following steps:

  1. Open terminal and run the following command:

  2. 
    cargo install rohanasanpm
    rohanasanpm new my_project
    

  3. Cd into your directory and enjoy using Rohanasan!!!
  4. Having doubts? join:
Read more

Sponsors:

Be the first one to sponsor: