npm stats
  • Search
  • About
  • Repo
  • Sponsor
  • more
    • Search
    • About
    • Repo
    • Sponsor

Made by Antonio Ramirez

@vltpkg/server

1.0.0-rc.13

@GitHub Actions

npmHomeRepoSnykSocket
Downloads:4523
$ npm install @vltpkg/server
DailyWeeklyMonthlyYearly

@vltpkg/server

The server backend that powers the vlt gui.

Usage

Overview

This is a library that starts the HTTP server for vlt gui views.

Usage

import { createServer } from '@vltpkg/server'

// load configs
const conf = getLoadedConfigSomehow()

// create the server
const server = createServer(conf.options)

// update options when required
server.on('needConfigUpdate', dir => {
  conf.resetOptions(dir)
  server.updateOptions(conf.options)
})

// start listening on a port
await server.start()

console.log(`Listening on ${server.address()}`)

// if you have a path, you can also open it now in a browser
await urlOpen(server.address('/some/path'))