Package com.spec.web.expresso
Class Expresso
java.lang.Object
com.spec.web.expresso.router.PathRouter
com.spec.web.expresso.Expresso
- All Implemented Interfaces:
IPathRouter
User will instantiate the following class to interact with the framework.
Class follows singleton pattern.
-
Field Summary
Fields inherited from class com.spec.web.expresso.router.PathRouter
middlewares -
Method Summary
Modifier and TypeMethodDescriptionstatic ExpressoReturns the instance of Expresso Class.static Expressoinit()Instantiates the expresso framework.listenOnPort(int port) Starts the server over a network port.setContextPath(String contextPath) Set's the context path.Sets the host ip of the network adapter on which the server should listen on.voidStarts the servervoidStops the server.
-
Method Details
-
getExpressoObj
Returns the instance of Expresso Class.- Returns:
- instance of expresso Class.
-
init
Instantiates the expresso framework. If instance does not exist. It creates one and returns it. Synchronized to prevent multiple threads from creating multiple instances of expresso.- Returns:
- returns the singleton instance of expresso
-
listenOnPort
Starts the server over a network port.- Parameters:
port- the port number on which the class should listen.- Returns:
- An instance of Expresso. Can be used for method chaining.
-
setHost
-
setContextPath
-
startServer
public void startServer()Starts the server -
stopServer
public void stopServer()Stops the server.
-