Giter VIP home page Giter VIP logo

magnetar's Introduction

[ IN PROCESS... ]


Requeriments:

system compiler extra
linux g++ -pthread flag

Latest changes

  • now you can render cpp code embedded in html files
  • add: post, put, deletex, patch, head, options, link, unlink and purgue with x-www-form-urlconded, geturl, plain/text params each one of them
  • added POST and PUT routes with x-www-form-urlencoded and plain/text

how to get and clone


$ git clone https://github.com/scyth3-c/Magnetar.git

$ git submodule init

$ git subodule update
 

compile and use

  make:
  
    $ cd magnetar-core
    $ make 
    $ ./binary
    

all examples work

a preview of my web server, intuitive and easy to use

well, I wanted to make public the whole process/growth of this project, it is a web server in c++ whose requirements are to have g++ and linux only, currently, only attends GET and others requests but in the future I will expand little by little, it has several functions to make it more familiar as other web servers such as express in Node.js, it has a familiar syntax and I plan to insert existing modules that I uploaded previously as "addons" but I will try as much as possible not to add things to it. as much as possible not to add things that require something else like curl etc. to make it easier to use, here below you will find some screenshots of how it works. documentation is in process and if you want to collaborate do it without any fear, you can talk to me directly, my contact information is at at bohorquez.tech


html view render examples

hmtl

temp

cpp

How to

the functions passed to the routes as the parameters to HEADERS and JSON are Infinite!!! the best way to learn is by testing, you can compile the examples with g++

routes examples:

you can see that it's not so wordy, which is the point of this project, but I still have to improve some things... well let's take a look!


one

the parameters are quite flexible, I have inserted several paths for the sake of convenience


par

implement callbacks functions to the response methods and like a normal lambda function get its environment by reference by adding & between the [] to access the entire scope


call

there are also middlewares, functions that we can add to control the route, they are infinite you can add as many as you want but you must add in next() to get to the next function or it will return that one.


middlewae

Files, you can send the content of files directly


files

but there are things to improve, for example json processing, it is still incomplete.


json

Recomendacion

there are still many other functions like the headers or the return system, so I recommend you to take a look at the examples

performase

idle

RAM CPU read / write
2 MB 0.0 N/D-N/D

responding

RAM CPU read / write
2MB 0.0 N/D-N/D

Extra

Español

bueno, queria hacer publico todo el proceso/crecimiento de este proyecto, se trata de un servidor web en c++ cuyos requisitos son tener g++ y linux nada mas,actualmente, solo atiende peticions GET pero en en futuro ire ampliando poco a poco, tiene varias funciones para que sea mas familiar como otros servidores web como express en Node.js, tiene una sintaxis familiar y planeo inscrustarle modulos ya existentes que subi anteriormente como "addons" pero tratare lo mas posible de no agregar cosas que requieran de algo mas como curl etc. para que sea mas facil de usar, aqui abajo econtraran algunas capturas de como funciona, la documentacion esta en proceso y si quieres colaborar hazlo sin miedo alguno, puedes hablar conmigo directamente, mi informacion de contacto esta en bohorquez.tech

magnetar's People

Contributors

scyth3-c avatar

Stargazers

 avatar  avatar

Watchers

 avatar

Forkers

jhoncarlosam

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.