Discussion
Loading...

Post

  • About
  • Code of conduct
  • Privacy
  • Users
  • Instances
  • About Bonfire
Emelia 馃懜馃徎
@thisismissem@hachyderm.io  路  activity timestamp last month
@Shini92 not bad if you like that pattern? Have you seen @adonisframework with its dependency injection stuff?

I know there's some folks in that community that like the spring boot style decorators for declaring routes and stuff

  • Copy link
  • Flag this post
  • Block
Shini92 :ablobblewobble:
@Shini92@mas.to replied  路  activity timestamp last month
@thisismissem @adonisframework Yes, I saw it, but it sadly uses uses also old style decorators from TS with `emitDecoratorMetadata: true`.
My implementation does not use `emitDecoratorMetadata: true`!

I also orientate myself currently a bit between #nestjs, #quarkus and #springboot.

  • Copy link
  • Flag this comment
  • Block
Emelia 馃懜馃徎
@thisismissem@hachyderm.io replied  路  activity timestamp last month
@Shini92 @adonisframework yeah, but that'll be changing soon iirc. There's just one decorator that's @inject()
  • Copy link
  • Flag this comment
  • Block
Shini92 :ablobblewobble:
@Shini92@mas.to replied  路  activity timestamp last month
@thisismissem @adonisframework 馃敎鈩笍
But right now I do not have any kind of "dependency injection" 馃憖
Maybe I will add that, but right now it really just looks for `glob("./**/*.controller.js")` 馃槅 and registers them. That's why I think about using `@RestController` instead.
  • Copy link
  • Flag this comment
  • Block
Emelia 馃懜馃徎
@thisismissem@hachyderm.io replied  路  activity timestamp last month
@Shini92 I'd probably just give people a `HttpContext` value in, which provides access to all the params, path variables, headers, response methods, bodies, etc. Because then you can extend the HttpContext to have additional methods or data like validation or uploads or auth
  • Copy link
  • Flag this comment
  • Block
Shini92 :ablobblewobble:
@Shini92@mas.to replied  路  activity timestamp last month
@thisismissem I just started. But yes, I will experiment step by step with it. And I have planned to provide NestJS style `@Request` and `@Response` decorators and such, so that the dev can use the context as they need.

Also I might add `@Consumes(mediaType)` and `@Provides(mediaType)` and potentially switch to ` @Get(pathMapping)` and `@RestController(pathMapping)` (which then set the media type to `application/json` by default)

... and stuff like that ...

That's why its private and poc :D

  • Copy link
  • Flag this comment
  • Block
Log in

bonfire.cafe

A space for Bonfire maintainers and contributors to communicate

bonfire.cafe: About 路 Code of conduct 路 Privacy 路 Users 路 Instances
Bonfire social 路 1.0.0-rc.2.21 no JS en
Automatic federation enabled
  • Explore
  • About
  • Members
  • Code of Conduct
Home
Login