Netlib is a free and open source c++ library for backend development inspired by Django.
-
Full SSL/TLS support
-
Dynamic URL support
-
Middlewares Feature
-
High Performance template engine
-
Database support
-
Multithreaded
-
Super Fast
-
Highly Portable
-
Cross Plateform
-
Open Source
-
OpenSSL
-
Asio
-
libmysqlclient (optional)
-
Curl (optional)
-
inja Template engine
-
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 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>
For more exmaples go to exmaples
Documentation is yet not generated
we will provide Documentation as soon as possible
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]
For support, email [email protected]