New:Introducing Socket Scanning for VS Code Marketplace Extensions.Learn more →
Get Started

@synthql/handler-next

Package Overview
Dependencies
Maintainers
1
Versions
29
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@synthql/handler-next

SynthQL-compatible route handler function for use in Next.js App Router.

npmnpm
Version
0.104.4
Version published
Weekly downloads
1
-92.31%
Maintainers
1
Weekly downloads
 
Created
Source

@synthql/handler-next

SynthQL-compatible route handler function for use in Next.js App Router.

// src/queryEngine.ts
import { QueryEngine } from '@synthql/backend';

export const queryEngine = new QueryEngine({
    url: process.env.DATABASE_URL,
});

// src/app/[...synthql]/route.ts
import { createNextSynthqlHandler } from '@synthql/handler-next';
import { queryEngine } from './queryEngine';

const nextSynthqlRequestHandler = createNextSynthqlHandler(queryEngine);

export async function POST(request: Request) {
    return await nextSynthqlRequestHandler(request);
}
  • Website
  • Docs
  • X/Twitter
  • GitHub

FAQs

Package last updated on 15 Oct 2024

Related posts