Socket
Book a DemoInstallSign in
Socket

elysia-convex

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

elysia-convex

Use Elysia with Convex

1.0.4
latest
Source
npmnpm
Version published
Weekly downloads
4
Maintainers
1
Weekly downloads
 
Created
Source

elysia-convex

elysia-convex is a package that integrates Elysia and Convex to create seamless routing and request handling for your applications.

Installation

To install the package, use npm or yarn:

npm install elysia-convex
# or
yarn add elysia-convex

Usage

Basic Example

Here's a simple example demonstrating how to use elysia-convex in your project:

import { convex, Elysia, HttpRouterWithElysia } from 'elysia-convex';
import { ActionCtx } from './_generated/server';
import { swagger } from '@elysiajs/swagger';
import { api } from './_generated/api';
import { cors } from '@elysiajs/cors';

export const api_controller = new Elysia({ prefix: '/api' })
	.use(convex<ActionCtx>())
	.get('/convex', async (c) => {
		const res: string = await c.ctx.runAction(api.tasks.hello);
		console.log(res, 'convex is cool');
		return res;
	});

export const elysia = new Elysia()
	.use(swagger())
	.use(cors())
	.use(convex<ActionCtx>())
	.get('/', (c) => 'Hello World!')
	.use(api_controller);

export default new HttpRouterWithElysia(elysia);

Keywords

elysia

FAQs

Package last updated on 23 Aug 2024

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

About

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.

  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc

U.S. Patent No. 12,346,443 & 12,314,394. Other pending.