seagull-js/seagull

View on GitHub
examples/helloworld/src/routes/params_route.ts

Summary

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

export default class ParamsRoute extends Route {
  static path = '/params/:id'
  static async handler(this: RouteContext) {
    const data = {
      body: this.request.body,
      headers: this.request.headers,
      method: this.request.method,
      params: this.request.params,
      path: this.request.path,
      query: this.request.query,
    }
    this.json(data)
  }
}