seagull-js/seagull

View on GitHub
examples/helloworld/src/routes/crud/read.ts

Summary

Maintainability
A
0 mins
Test Coverage
import { Route, RouteContext } from '@seagull/routes'
import { Term } from '../../items'

export default class extends Route {
  static path = '/glossary/:id'

  static async handler(this: RouteContext) {
    const id = decodeURIComponent(this.request.params.id)
    const item = await Term.get(id)
    this.render('crud/Details', { item })
  }
}