QServer or QuantumServer is a HTTP server & handler based on Router
and Route
For this, We will create a Router object. As a parameter, we will pass in a port number (1 - 65535), debug mode activation (true | false) and a Route object.
import qu.cipherr.QServer.Router;
import qu.cipherr.QServer.Objects.Route;
public class MyAwesomeApp {
public static void main(String[] args){
Router s = new Router(9999, true, new Route("/", new MyRouteHandler()));
s.start();
}
}
You can create handlers separate classes:
package my.pack;
import qu.cipherr.QServer.Objects.Route;
import my.pack.MyHandler;
public class MyAwesomeApp{
public static void main(String[] args){
MyHandler h = new MyHandler(); // The handler class
Route route = new Route("/path", h); // The route class
Router s = new Router(1025, true, new Route("/", new MyOtherHandler()), route);
// s.addRoute(route) // same
s.start();
}
}
- Telegram: @QuantumCipherr
- E-Mail: [email protected]