Swiftui2Lvn.HttpServer (swiftui_2_lvn v0.1.6)

View Source

Lightweight HTTP server for VSCode plugin integration.

Provides a simple REST API that the VSCode plugin can communicate with:

  • POST /convert - Convert SwiftUI code to LiveViewNative
  • GET /health - Health check endpoint
  • POST /shutdown - Graceful shutdown

The server can be spawned on-demand by the VSCode plugin and shut down when done.

Summary

Functions

Callback implementation for Plug.call/2.

Callback implementation for Plug.init/1.

Start the HTTP server on the specified port.

Functions

call(conn, opts)

Callback implementation for Plug.call/2.

init(opts)

Callback implementation for Plug.init/1.

start(opts \\ [])

Start the HTTP server on the specified port.

Options

  • :port - Port to listen on (default: 4040)
  • :host - Host to bind to (default: "127.0.0.1")

Examples

# Start on default port 4040
Swiftui2Lvn.HttpServer.start()

# Start on custom port
Swiftui2Lvn.HttpServer.start(port: 4041)