@vltpkg/server
Classes
VltServer
Defined in: index.ts:74
This class handles the starting and stopping of the server, but the actual response handling is all done in the handleRequest function.
Extends
EventEmitter<{needConfigUpdate: [string]; }>
Constructors
new VltServer()
new VltServer(options): VltServerDefined in: index.ts:91
Parameters
options
Returns
Overrides
EventEmitter<{ needConfigUpdate: [string]}>.constructorProperties
appData?
optional appData: AppDataManager;Defined in: index.ts:80
assetsDir?
optional assetsDir: string;Defined in: index.ts:88
config?
optional config: ConfigManager;Defined in: index.ts:81
dashboard?
optional dashboard: Dashboard;Defined in: index.ts:79
dashboardRoot
dashboardRoot: string[];Defined in: index.ts:87
hasDashboard
hasDashboard: boolean = falseDefined in: index.ts:82
options
options: VltServerOptionsDefined in: index.ts:83
port?
optional port: number;Defined in: index.ts:84
publicDir?
optional publicDir: string;Defined in: index.ts:86
securityArchive
securityArchive: | undefined | SecurityArchive;Defined in: index.ts:89
server
server: ServerDefined in: index.ts:85
Methods
address()
address(path): stringDefined in: index.ts:105
Parameters
path
string = '/'
Returns
string
close()
close(): Promise<void>Defined in: index.ts:238
Returns
Promise<void>
listening()
listening(): this is VltServerListeningDefined in: index.ts:101
Returns
this is VltServerListening
start()
start(__namedParameters): Promise<void>Defined in: index.ts:116
If no port is specified, then it’ll start counting up from 8000 until it finds one that does not fail with EADDRINUSE.
Parameters
__namedParameters
Returns
Promise<void>
update()
update(this): Promise<void>Defined in: index.ts:188
Parameters
this
Returns
Promise<void>
updateGraph()
updateGraph(this): Promise<void>Defined in: index.ts:166
Parameters
this
Returns
Promise<void>
updateOptions()
updateOptions(options): voidDefined in: index.ts:174
Parameters
options
Returns
void
Type Aliases
VltServerListening
type VltServerListening = VltServer & objectDefined in: index.ts:58
Type declaration
assetsDir
assetsDir: stringconfig
config: ConfigManagerport
port: numberpublicDir
publicDir: stringVltServerNotListening
type VltServerNotListening = VltServer & objectDefined in: index.ts:65
Type declaration
port
port: undefinedpublicDir
publicDir: undefinedVltServerOptions
type VltServerOptions = InstallOptions & UninstallOptions & ActualLoadOptions & objectDefined in: index.ts:40
Type declaration
assetsDir?
optional assetsDir: string;dashboard-root?
optional dashboard-root: string[];loadedConfig?
optional loadedConfig: LoadedConfig;packageJson
packageJson: PackageJsonpublicDir?
optional publicDir: string;VltServerStartOptions
type VltServerStartOptions = objectDefined in: index.ts:54
Type declaration
port?
optional port: number;Functions
createServer()
function createServer(options): VltServerDefined in: index.ts:37
Parameters
options
Returns
getProjectData()
function getProjectData(__namedParameters, folder): objectDefined in: graph-data.ts:83
Parameters
__namedParameters
packageJson
scurry
folder
Returns
object
homedirRelativeRoot
homedirRelativeRoot: stringroot
root: stringtools
tools: ProjectTools[];vltInstalled
vltInstalled: booleanreadProjectFolders()
function readProjectFolders( __namedParameters, maxDepth,): Promise<PathBase[]>Defined in: read-project-folders.ts:41
Retrieves folders from a given directory, if that directory is recognized to be the current cli project root folder then we proceed to read its siblings.
Traverses nested directory recursively until project folders can be find, always stopping at the first level where a package.json is present.
Parameters
__namedParameters
ProjectFolderOptions
maxDepth
number = 7
Returns
Promise<PathBase[]>
reloadConfig()
function reloadConfig(folder): Promise<ParsedConfig>Defined in: config-data.ts:26
Parameters
folder
string
Returns
Promise<ParsedConfig>