-
-
Notifications
You must be signed in to change notification settings - Fork 0
Module: Server
Aviril edited this page Mar 16, 2024
·
2 revisions
const server: cServer = vNetwork.create(
object: options // (Optional): server's connection options
)
// Client Options:
options: {
port: 3000, // Server's port
hostname: "localhost", // If left unspecified, will fallback to 'window.location.hostname'
isSSL: true // Bool indicating whether SSL is enabled on server
}
// Server Options:
options: {
port: 3000, // Server's port,
bandwidth: 1, // Server's max bandwidth in mb
isCaseSensitive: false, // Determines whether the routes are case-sensitive
cors: {} // Cors options
}
const bool: state = vNetwork.setSSLCert(
object: sslcert // (Optional): Omitting will result in SSL-Cert to be revoked (If any)
)
const bool: state = cServer.destroy()
const object: config = cServer.fetchConfig()
const object: server = cServer.fetchServer(
string: index // Index could be either of "express", "http"
)
// Client Syntax:
const bool: state = cServer.isConnected(
bool: isSync // (Optional): If enabled, retrieves result immediately
bool: fetchHealth // (Optional): If enabled, fetches server's realtime health via health-point
)
// Server Syntax:
const bool: state = cServer.isConnected(
bool: isSync // (Optional): If enabled, retrieves result immediately
)
const bool: state = cServer.connect()