Documentation
Starting the Server
LiteNode streamlines the process of starting the HTTP server by integrating the startServer
method directly into the framework. This simplifies server initialization and configuration, allowing developers to focus more on building their applications.
startServer
Signature:
startServer(port?: number): http.Server
Starts the HTTP server and listens on the specified port.
port
: Optional port number to listen on (default: 5000).- Returns: The HTTP server instance.
Start the server on a specified port:
// Start the HTTP server
app.startServer(3000)
This will start the server and listen for incoming requests on port 3000.