Git Product home page Git Product logo

rohanasan / rohanasan Goto Github PK

View Code? Open in Web Editor NEW
0.0 0.0 0.0 364 KB

Rohanasan: An Extremely fast backend framework for multiple programming languages (Currently available for C and C++). It is extremely easy as well, just run the project maker script present in the README.md and create your own project with Rohanasan as the backend framework!

License: MIT License

HTML 2.10% C 97.90%
backend-framework backend-frameworks c cplusplus rohanasan performance

rohanasan's Introduction

Introducing Rohanasan

An extremely fast backend framework for multiple programming languages!

Made with Performance, optimization and ease of use in mind. Currently available in C programming language only Please use a linux/unix/mac kind of os

How to run example:

  • Run: git clone https://github.com/rohanasan/rohanasan_c.git
  • Next, Run: cd rohanasan_c/example
  • Make sure you are using a linux/unix/mac like operating system with gcc/clang installed
  • Run: gcc -o server ./server.c or clang -o server ./server.c depending on the compiler you want to use/have installed.
  • Run: ./server
  • Visit: localhost:8080
  • Then: ๐Ÿ‘ for yourself, you just ran the rohanasan's example!
  • You can host the example folder as well!!! Use the docker file, It has all the correct configuration!

How to use in your project?

  • Open terminal inside the parent folder where you would like to create the folder of your project
  • Run:
curl https://raw.githubusercontent.com/rohanasan/rohanasan_c/main/project_maker.c -o project_maker.c
gcc ./project_maker.c
./a.out
rm ./project_maker.c
rm ./a.out
  • Now, you cd into the folder created my the rohanasan project maker software.
  • then run:
  • make release run to run your project!
  • Enjoy using Rohanasan!

html response hello world looks like this:

#include "./include/rohanasan.h"

const char* handle(struct request req)
{
    return send_http_response(default_html_header,
        "<h1>Hello from Rohanasan!</h1>");
}

int main()
{
    init(8080);
    serve(handle);
    return 0;
}

Discord server link:

https://discord.gg/Yg2A3mEret

Current Features:

  • Asyncronous file request handeling
  • Can run a server at a specified port
  • Can serve a folder named static at /static
  • Can send files as http response
  • Can give you the path, method and protocol

TODO:

  • Add feature to give the get path. โ˜‘๏ธ Just did it! And Fixed it!
  • Add feature to give the post path. โ˜‘๏ธ Just did it! And tested!
  • Add feature to handle: /xyz/, /xyz?q=asdf, /xyx/?q=asdf and not only /xyz โ˜‘๏ธ Did this as well!
  • Add feature to change the directory path of the public folder โ˜‘๏ธ Done!!!!
  • Add feature to give the user an option to add index.html to static folder
  • Add feature to... currectly its just a pre alpha release I have to add alot of features right now!

Contribute:

https://www.buymeacoffee.com/rohanvashisht

rohanasan's People

Contributors

rohanvashisht1234 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.