Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add lix server protocol handler #3233

Merged

Conversation

samuelstroschein
Copy link
Member

Context

Adds a lix server protocol handler to the lix sdk that apps can embed as pleased.

This is a great pattern that emerged while setting up a server for lix.

  • SDK has full control over server protocol

  • apps can embed the server handler however they need (ecosystem of lix hosts)

  • plain simple JS (no server framework, eases maintenance, ensures that handler runs everywhere)

Lix Server Protocol Handler

Embed the lix server protocol in your own application.

  • works in any JS runtime (node, browser, deno)
  • no UI, bells or whistles, just handling the lix server protocol

Usage

import { createLspHandler } from '@lix-js/sdk';

// or any other server framework (express, koa, hono, etc.)
const app = new Hono();

const lsp = createLspHandler({
  // options
});

// add the handler to your app
// the handler will handle all requests to /lsp/*
app.use('/lsp/*', (req) => {
  // depending on your server framework, 
  // the request and response need to be mapped
  const response = await lsp(request);
  return response;
});

Copy link

changeset-bot bot commented Nov 23, 2024

⚠️ No Changeset found

Latest commit: cbe034c

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@samuelstroschein samuelstroschein merged commit a59b6b7 into lix-integration Nov 23, 2024
2 checks passed
@samuelstroschein samuelstroschein deleted the lixdk-240-query-server-local-mutation-log branch November 23, 2024 00:59
@github-actions github-actions bot locked and limited conversation to collaborators Nov 23, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant