Skip to content

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

Notifications You must be signed in to change notification settings

darshan-open-source/netlib

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

๐Ÿš€ 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

About

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

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages