0.3.12 • Published 3 months ago

elysiajs-nuxt v0.3.12

Weekly downloads
-
License
MIT
Repository
github
Last release
3 months ago

elysiajs-nuxt

Easily integrates elysia with nuxt, now supporting @nuxt/devtools and @elysiajs/eden!

Demo

https://github.com/nuxt/nuxt/assets/13268073/d5c96902-698f-482a-8360-9f657ab40eba

Usage

Development Environment

  1. install packages
# currently only supports Bun
bun add elysiajs-nuxt
bun add nuxt elysia --dev
  1. configure nuxt.config.ts
// src-client/nuxt.config.ts
export default defineNuxtConfig({
  // mandatory configuration!
  nitro: { preset: import.meta.resolveSync('elysiajs-nuxt/preset') },
  // mandatory configuration!
  vite: { server: { origin: 'localhost:3000' } }
})
  1. use elysiajs-nuxt as a plugin
// src-server/index.ts
import { Elysia } from 'elysia'
import elysiaNuxt from 'elysiajs-nuxt'

new Elysia().use(elysiaNuxt).listen(5566)
  1. simultaneously start dev servers, both client(nuxt) and server(elysia)
# server
bun run --watch src-server
# client
bun --bun nuxt dev src-client/index.ts

Production Environment

  1. compile the Client
bun --bun nuxt build src-client
  1. start the Server
# mandatory configuration!
NODE_ENV=production bun run src-server/index.ts

Example

Author

Languages

0.3.12

3 months ago

0.3.11

4 months ago

0.3.10

4 months ago

0.3.9

6 months ago

0.3.8

6 months ago

0.3.7

6 months ago

0.3.6

6 months ago

0.3.5

6 months ago

0.3.4

6 months ago

0.3.3

6 months ago

0.3.2

6 months ago

0.3.1

6 months ago

0.3.0

6 months ago

0.2.0

6 months ago

0.1.0

6 months ago