Skip to content

Latest commit

 

History

History
30 lines (23 loc) · 556 Bytes

README.md

File metadata and controls

30 lines (23 loc) · 556 Bytes

Lokal JS

Library for interacting with Lokal Client REST API

npm i lokal-js
import { Lokal } from 'lokal-js';

async function main() {
	const lokal = new Lokal();

	const tunnel = await lokal
		.newTunnel()
		.setLocalAddress('localhost:3000')
		.setTunnelType('HTTP')
		// .setPublicAddress('myapp.k.lokal-so.site')
		.setLANAddress('my-app.local')
		.showStartupBanner()
		.ignoreDuplicate()
		.create();

	const lanAddress = await tunnel.getLANAddress();
	console.log('LAN Address:', lanAddress);
}

main().catch(console.error);