github wobsoriano/elysia-autoroutes v0.3.0

latest releases: v0.5.0, v0.4.0
13 months ago

Breaking

  • Set Elysia peer dep to ^0.6.0

  • Route files should now export default a function that accepts ElysiaApp and returns ElysiaApp, which gets passed to group.

Before:

import type { Context } from 'elysia'

export const get = (context: Context) => ({ ... })

export const post = (context: Context) => ({ ... })

export const del = (context: Context) => ({ ... })

After:

import type Elysia from 'elysia'

export default (app: Elysia) => app
  .get('/', () => ({ ... }))
  .post('/', () => ({ ... }))
  .put('/', () => ({ ... }))
  .patch('/', () => ({ ... }))
  .delete('/', () => ({ ... }))

Don't miss a new elysia-autoroutes release

NewReleases is sending notifications on new releases.