Skip to content

Latest commit

 

History

History
131 lines (79 loc) · 2.31 KB

README.md

File metadata and controls

131 lines (79 loc) · 2.31 KB

🚀 Netlib

Netlib is a free and open source c++ library for backend development inspired by Django.

Features

  • Full SSL/TLS support

  • Dynamic URL support

  • Middlewares Feature

  • High Performance template engine

  • Database support

  • Multithreaded

  • Super Fast

  • Highly Portable

  • Cross Plateform

  • Open Source

Third Party Dependency

  • OpenSSL

  • Asio

  • libmysqlclient (optional)

  • Curl (optional)

  • inja Template engine

Simple Usage

  • First generate settings.h File

    settings.h file contains important setting of your website

#ifndef SETTINGS_INCLUDED
#define SETTINGS_INCLUDED

#define DEBUG    // for trace execution in development mode
#define USE_SSL  // for HTTPS

#define SESSION_DIRECTORY "/home/darshan/Documents/temp_test/temp_sessions/"
#define UPLOADED_FILES_DIRECTORY "/home/darshan/Documents/code/netlib(main)/temp_files/"
#define DEFAULT_STATIC_DIRECTORY "/home/darshan/Documents/code/netlib(main)/static/"
#define BUILTIN_STATIC_DIRECTORY "/home/darshan/Documents/code/netlib(main)/default_statics/"
#endif
  • generate cpp file for your website
#include <iostream>
#include "includes/webserver.h"
#include "includes/public_directory.h"
using namespace std;

RESPONSE admin(httpRequest req, httpResponse res, void *)
{

    return res.HttpResponse("hello from admin");
}

int main()
{

    webserver s("127.0.0.1", 8085);

    s.onRequest("/", "index.html");
    s.onRequest("/admin", admin);

    s.startServer();
    s.runServer();
}

Build and Run The project

Build code with CMake and make

  cmake .
  make

Now executable is generated in present Directory

To run the the the code just simply execute this

./<executable name>

Exmaples

For more exmaples go to exmaples

Documentation

Documentation is yet not generated

we will provide Documentation as soon as possible

IMPORTANT NOTES

This library is in development and developer is continuously updating the code.

if anyone found any type of bug or want to suggest any feature contact us at [email protected]

Authors

Support

For support, email [email protected]

License

MIT